If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Syntax error in query expression
Good morning,
I am attempting to calculate the "Obl Fees" field of my data entry form by multiplying the "LU_Type" and "Units" fields of the same form. The only complications are that the "LU_Type" field is a pull down menu referencing a table called "tbl_LU_Type" and that the equation is actually referencing a different column in the table than what is shown ("LU_Type" is shown, but I am referencing the "Fee Per Unit" column in my equation). Using code editor, I have added the following line of script to the after update fields of both the "LU_Type" and "Units" fields: Private Sub Units_AfterUpdate() If Not IsNull(Me.[LU_Type]) And Not IsNull(Me.[Units]) Then Me.[Obl Fees] = DFirst("Fee Per Unit", "tbl_LU_Type", "LU_Type=" & Me.[LU_Type] & "") * Me. [Units] End If "LU_Type" is the first field that gets data entered into it. Everything goes well there. It is when I enter data to the second field "Units" that I get the following error: Run Time Error 3075. Syntax Error (Missing Operator) in query expression 'first(Fee Per Unit)'. If anyone could tell me what's going on and how to remedy it, I would be greatly appreciative. Thanks, Kendra |
#2
|
|||
|
|||
Syntax error in query expression
"Vernon" wrote in message ... Good morning, I am attempting to calculate the "Obl Fees" field of my data entry form by multiplying the "LU_Type" and "Units" fields of the same form. The only complications are that the "LU_Type" field is a pull down menu referencing a table called "tbl_LU_Type" and that the equation is actually referencing a different column in the table than what is shown ("LU_Type" is shown, but I am referencing the "Fee Per Unit" column in my equation). Using code editor, I have added the following line of script to the after update fields of both the "LU_Type" and "Units" fields: Private Sub Units_AfterUpdate() If Not IsNull(Me.[LU_Type]) And Not IsNull(Me.[Units]) Then Me.[Obl Fees] = DFirst("Fee Per Unit", "tbl_LU_Type", "LU_Type=" & Me.[LU_Type] & "") * Me. [Units] End If "LU_Type" is the first field that gets data entered into it. Everything goes well there. It is when I enter data to the second field "Units" that I get the following error: Run Time Error 3075. Syntax Error (Missing Operator) in query expression 'first(Fee Per Unit)'. If anyone could tell me what's going on and how to remedy it, I would be greatly appreciative. Thanks, Kendra Hi, Well ... no certainty here, but the first thing I'd try is ... DFirst("[tbl_LU_Type]![Fee Per Unit]", "tbl_LU_Type", "LU_Type=" & Me.[LU_Type] & "") Spaces in field names can cause a variety of havoc all their own :-) From a first look, that's the only sensible suggestion I can make. HTH MFK. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
EXPRESSION IN A QUERY | Peter Schweiss | Running & Setting Up Queries | 2 | July 14th, 2004 06:40 AM |
Hidden files in Ms-Query cause ODBC connect errors or Query is wac | needyourhelp | General Discussion | 4 | July 12th, 2004 09:38 PM |
syntax to run PL/SQL stored proc via ms access pass through query | Edwinah63 | General Discussion | 2 | June 23rd, 2004 03:47 AM |
query field reference help | -dch | Running & Setting Up Queries | 4 | June 2nd, 2004 07:30 PM |