V
vandy
Hi all,
I am trying to open a new form using a button on my form. Using Access 2003.
In the button click event i have asked to open a new instance of the form
"add projects"
Right now when i click the add button a new blank form for data entry is
available but i want it to pop out and the user types in the entry. I am
getting syntax errors like ProjectID control name not found in the requery
statement.
My table is very simple.
tblprojects
ProjectID - autonumber
Pno - Project number - primary key
Pname - Project name
what am i doing wrong. I was trying to use this as a macro the same error
popped up , so i converted it into vb code. Any help will be greatly
appreciated as i have to pop up many more forms for data entry.
Private Sub add_record_Click()
On Error GoTo add_record_Click_Err
DoCmd.OpenForm "Add Projects", acNormal, "", "", acAdd, acDialog
DoCmd.GoToRecord , , acNewRec
DoCmd.Requery , "ProjectID"
add_record_Click_Exit:
Exit Sub
add_record_Click_Err:
MsgBox Error$
Resume add_record_Click_Exit
End Sub
thanks in advance
I am trying to open a new form using a button on my form. Using Access 2003.
In the button click event i have asked to open a new instance of the form
"add projects"
Right now when i click the add button a new blank form for data entry is
available but i want it to pop out and the user types in the entry. I am
getting syntax errors like ProjectID control name not found in the requery
statement.
My table is very simple.
tblprojects
ProjectID - autonumber
Pno - Project number - primary key
Pname - Project name
what am i doing wrong. I was trying to use this as a macro the same error
popped up , so i converted it into vb code. Any help will be greatly
appreciated as i have to pop up many more forms for data entry.
Private Sub add_record_Click()
On Error GoTo add_record_Click_Err
DoCmd.OpenForm "Add Projects", acNormal, "", "", acAdd, acDialog
DoCmd.GoToRecord , , acNewRec
DoCmd.Requery , "ProjectID"
add_record_Click_Exit:
Exit Sub
add_record_Click_Err:
MsgBox Error$
Resume add_record_Click_Exit
End Sub
thanks in advance