Query Works but it keeps asking for Parameter Values

AJohnston

New member
Local time
Today, 06:26
Joined
Jan 10, 2023
Messages
7
Hi All,

This code doesn't throw any errors other than popups asking for parameter values: DriverID first and then ComboID second

Private Sub cboVanNumber_AfterUpdate()

Dim ComboID As Integer
Dim strSQL As String
Dim DriverID As Integer

DriverID = Forms!frmRoute!txtDriverID
ComboID = Forms!frmRoute!cboVanNumber.Value

strSQL = "UPDATE tblVan SET tblVan.FK_ID_Driver = DriverID " & vbCrLf & _
"WHERE (((tblVan.VanNumber)=ComboID));"
DoCmd.RunSQL strSQL

End Sub


Thanks!
 
change your query to:
Code:
strSQL = "UPDATE tblVan SET tblVan.FK_ID_Driver = " & DriverID & " " & vbCrLf & _
"WHERE (((tblVan.VanNumber)=" & ComboID & "));"
 
That could all go on one line? :(
 

Users who are viewing this thread

Back
Top Bottom