In MS ACCESS:

1. Create a new, standard module with the name of CustomFunctions and within it, create the following function as shown below:

```vb
Function Travel(CountryValue, SalaryValue)
If CountryValue = "USA" Then
If SalaryValue < 60000 Then
Travel = 2000
ElseIf SalaryValue < 70000 Then
Travel = 1500
End If
End If
End Function
```

2. Create a new query in Query Design View based on the Consultant table with the following instructions to test the new custom function, the Travel function, as used within a query:
- Use LastName, Reside, and Salary fields from the Consultant table.
- Create a new calculated field named TravelExpense that uses the new Travel function with the Reside field for the CountryValue argument and the Salary field for the SalaryValue argument.

3. Save the query with the name TravelCalculation and then display it in Datasheet View to test your new custom function and calculated field.

4. Close the TravelCalculation query.

Answer :

Final answer:

To create a new query in MS Access using a custom function, follow these steps:

  1. Create a new module named 'CustomFunctions'.
  2. In the CustomFunctions module, define the custom function named 'Travel'.
  3. Create a new query in Query Design View and add the desired fields from the Consultant table.
  4. Add a calculated field named 'TravelExpense' using the custom function 'Travel' with the appropriate arguments.
  5. Save the query as 'TravelCalculation' and test it in Datasheet View.

Explanation:

To create a new query in MS Access using a custom function, follow these steps:

Step 1: Create a new module

Open MS Access and go to the Database Tools tab. Click on the Visual Basic button to open the Visual Basic for Applications (VBA) editor. In the VBA editor, go to Insert and click on Module to create a new module. Name the module 'CustomFunctions'.

Step 2: Define the custom function

In the CustomFunctions module, enter the following code:

Function Travel(CountryValue, SalaryValue)

If CountryValue = ""USA"" Then

If SalaryValue < 60000 Then

Travel = 2000

ElseIf SalaryValue < 70000 Then

Travel = 1500

End If

End If

End Function

Step 3: Create a new query

Go to the Create tab and click on Query Design. Select the Consultant table and add the LastName, Reside, and Salary fields to the query design grid.

Step 4: Add the calculated field

In the query design grid, right-click on an empty column and select Build... from the context menu. In the Expression Builder, enter the following expression:

Travel([Reside], [Salary])

Name the calculated field 'TravelExpense'.

Step 5: Save and test the query

Save the query with the name 'TravelCalculation'. Switch to Datasheet View to test the new custom function and calculated field. Close the TravelCalculation query when done.

Learn more about creating a new query in ms access using a function here:

https://brainly.com/question/31230588

#SPJ14