I'm having difficulty with an Insert Into - I have the following code:
Instead of the value of hostname going into the table, I get a pop up box asking me for parameters. And the popup box's label just happens to be the value of hostname!
Where I am going wrong?
Thanks Much,
Rick
Code:
Private Sub Serial_AfterUpdate()
Dim MyDB As Database
Dim hostname As String
Set MyDB = CurrentDb
hostname = Me.Serial
DoCmd.RunSQL "INSERT INTO tblTemp (tmptoHostname) VALUES (" & hostname & ")"
If Me.Serial = "PDS*" Then
Me.Serial = Right(Me.Serial, Len(Me.Serial) - 3)
End If
End Sub
Instead of the value of hostname going into the table, I get a pop up box asking me for parameters. And the popup box's label just happens to be the value of hostname!
Where I am going wrong?
Thanks Much,
Rick