Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT causing parameter prompt

Status
Not open for further replies.
Jul 15, 2002
17
0
0
US
I am running the following code on a form in an Office XP database in Office 2000 file format:

Private Sub AccountManager_AfterUpdate()
Dim strDLR As String
Dim strSQL As String
Dim strAcct As String
Dim strDate As Date

strDate = Format(Date, mm - DD - yyyy)
strAcct = Me.AccountManager.Value
strDLR = Me.DLR_NUM.Value
strSQL = "INSERT INTO DealerRepLog (ChangeDate, Dealer, NewAcctRep) VALUES (#" & strDate & "#, " & strDLR & ", " & strAcct & ")"

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub

When I run the event, I get a enter parameter box. The message in the parameter box is the correct value of strDLR. The value entered into this box is then inserted into the Dealer field of the table. I am confused as to why it is behaving this way. Thanks in advance.

Chris Haufschild
chaufschild@hotmail.com
 
If strDLR and strAcct are TEXT, try this:

(#" & strDate & "#, '" & strDLR & "', '" & strAcct & "')"


Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top