the way i would do it is create an unbound form with a text box. the text box would be the information that i want updated. then on the update query make the update to section refer to the unbound form. put a control on the form that runs the update query.
ash
a parameter box is linked to an sql staemnet either in vba or the form is generated from a query. With the name field is it set to lookup a table that no longer exists or is the sql statement you are using have a criteria associated with it.
Ash
found easier way.
Private Sub Form_BeforeUpdate()
on error goto err_form_beforeupdate
If IsNull(fieldname) Then
x = MsgBox("fieldname is required")
cancel = True
Me.fieldname.SetFocus
Else
End If
Err_form_BeforeUpdate:
goto exit_form_beforeupdate
exit_form_BeforeUpdate:
Exit Sub...
Change the required field to no. Then on form close and change_record events add a validation rule
eg
Private Sub form_Close()
On Error GoTo Err_Form_Close
Dim strTblName As String, strValidRule As String
Dim strValidText As String
Dim intX As Integer
strTblName = "tablename"...
when you want to enter a ne3w record do you open that form form the switchboard. If so just set the properties on switchboard to open that form in addnew. And delete the on open event.
If not you can use the is loaded function.
eg
on from_open ()
if isloaded (parentform) then...
thats because you have set the command button event to click.
Go to anyother form and you will notice that when you hit enter on a field it goes to the next field. To rectify this put the same code on password (enter event) as you have on the command button. That way no matter wether the user...
does your form have the field id_componentName. If so make the where criteria [forms].[formname].[id_componentname]. It will fire the query based on form.
Ash