By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,668 Members | 1,503 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,668 IT Pros & Developers. It's quick & easy.

Syntax Error 3075

P: 51
I can not seem to get rid of this syntax error - hope someone can help out.
the error I am getting is:

Run time Error 3075
Syntax error missing operator in query expression

I have two forms (1) one with a combo box "cbobankacct" on form "accttransactionlist"

I am successful to have the value from the combo box generate into a text box of a second form.

second form "accttranslistpassword" and the text box that I am trying to generate the value into is "txtacctholder.

the value seems to imput in the text box fine but I get the syntax error when I try to run the password script.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cbobankacct_AfterUpdate()
  2.    DoCmd.OpenForm "AcctTransListPassword"
  3.    Forms!AcctTransListPassword!txtacctholder = Forms!AcctTransactionList!cbobankacct.Column(1)
  5. End Sub
I then have a text box "txtpassword" that I input the password into and that is when I get the syntax error

Expand|Select|Wrap|Line Numbers
  1. Private Sub txtpassword_AfterUpdate()
  3.     If IsNull(Me.txtpassword) Or Me.txtpassword = "" Then
  4.       MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
  5.         Me.txtpassword.SetFocus
  6.         Exit Sub
  7.     End If
  9.     If Me.txtpassword.value = DLookup("Password", "AcctHolder", _
  10.             "[AcctHolderID]=" & Me.txtacctholder.value) Then
  12.         MyAcctHolderID = Me.txtacctholder.value
  14.         DoCmd.Close acForm, "AcctTransListPassword", acSaveNo
  15.         DoCmd.RunMacro "AcctHolderMDB"
  17.     Else
  18.       MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
  19.             "Invalid Entry!"
  20.         Me.txtpassword.SetFocus
  21.     End If
  24. End Sub
If anyone can give me some direction that would be great! Everyone on this site has always been very helpful in the past.
Feb 28 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 8,634
If "[AcctHolderID] is a String, then you would need a change in Syntax to:
Expand|Select|Wrap|Line Numbers
  1. If Me.txtpassword.Value = DLookup("Password", "AcctHolder", _
  2.             "[AcctHolderID]= '" & Me![txtacctholder] & "'") Then
Feb 28 '10 #2

P: 51
thanks for the help! that did the trick!!!
thanks again.
Mar 1 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.