Argument not optional

Twin

Registered User.
Local time
Today, 00:02
Joined
May 19, 2000
Messages
26
Hi all,
i wonder if someone could help me,
i have a table based form that is used to enter data and one of the text fields is sourced from the field in the table updated via an update query.
i do my testing via a button, but i always get the Compile error 'Argument not optional' when i try to run it on the first DoCmd.SetWarnings line.
Without these, the code works without a problem.

Private Sub refresh_form_Click()
On Error GoTo Err_refresh_form_Click


Dim update As String
update = "CC_CITY"
DoCmd.SetWarnings = False
DoCmd.OpenQuery update, acViewNormal, acEdit
DoCmd.SetWarnings = True

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_refresh_form_Click:
Exit Sub

Err_refresh_form_Click:
MsgBox Err.Description
Resume Exit_refresh_form_Click

End Sub

is it possible to have the same functionality of table update without update query warning messages?

TIA
Chris
 
Is it correct to use an equal sign in the coding?

not

Code:
DoCmd.SetWarnings = False
DoCmd.SetWarnings = True
but

Code:
DoCmd.SetWarnings False
DoCmd.SetWarnings True
 
absolutely righ Pierre,
it is in Excel, but not in Access...i know it is going to something simple...

thanx m8

Chris
 
So did you try:

DoCmd.SetWarnings False

???
kh
 
Yes i did Ken,
worked like a charm...thanx
 

Users who are viewing this thread

Back
Top Bottom