Run Time error 424

Samt

Registered User.
Local time
Today, 11:48
Joined
Jul 22, 2009
Messages
13
I am trying to make an update statement for a resume form. I have one form that inserts first name last name and other stuff, and a second form that will update dates (interview date, phone screen date, ect.) there isnt really any thing in these fields on the table, but i have it so that the afterupdate for the combo box puts in the blank data into the text boxes, so i can update rather than insert.
Here is my query

Private Sub cmbresume_AfterUpdate()
Me!txtinitial.Value = Me!cmbresume.Column(3)
Me!txtphonescreen.Value = Me!cmbresume.Column(4)
Me!txtinterview.Value = Me!cmbresume.Column(5)
Me!txthire.Value = Me!cmbresume.Column(6)
End Sub

Private Sub cmdupdate_Click()

updateSQL = "UPDATE [Resume table] SET [Initial Contact Date] = '" & txtinitital.Value & "', [Phone Screen Date] = '" & txtphonescreen.Value & "', [Interview Date] = '" & txtinterview.Value & "', [Hire/Do Not Hire Date] = '" & txthire.Value & "' WHERE ResumeID = " & Me.cmbresume.Column(0)

DoCmd.RunSQL (updateSQL)
End Sub

when i try to run it, it gives the runtime error 424, object required
Please help
Thanks
-Sam
 
I don't do much of this sort of thing, but according to help the syntax doesn't use the parens around the SQL string, not


DoCmd.RunSQL (updateSQL)

but


DoCmd.RunSQL updateSQL

But why aren't you simply using a bound form so Access would handle all of this automnatically?
 
no luck with removing the parenthases. any one else have any ideas?
 
What line is the debugger highlighting when you get the error? Try adding this right before the RunSQL so you can see the final SQL in the Immediate window:

Debug.Print updateSQL
 
IT highlights on the upsateSQL = UPDATE [Resume table] .......

I tried using the debug.print, but it didnt work, or maybe i just didnt use it right
 
Is that all on one line in the code? Is upsateSQL declared somewhere as a string variable?
 
typo, sorry, i tried working backwards to only update one of hte columns,

updateSQL = "UPDATE [Resume table] SET [Initial Contact Date] = '" & txtinitital.Value & "' WHERE ID = " & Me!cmbresume.Column(0)

please help
 
Is the variable declared anywhere? Are the spellings of the 2 controls correct? Can you post the db?
 

Users who are viewing this thread

Back
Top Bottom