Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

addnew buttom is not work

Status
Not open for further replies.

site

Programmer
Oct 23, 2001
44
AT
site (Visitor) Aug 8, 2001
Hi, All,

I have a Access project, and connect to SQL server.
In the form I create "Add New" buttom, but doesn't work.

The following are my codes:

Sub AddNew_Click()
On Error GOTO Err_AddNew_Click

Dim strDocName As String
strDocName = "frmComplaints"
Docmd.OpenForm strDocName, , , , acAdd

ExitAddNew_Click:
Exit Sub

Err_AddNew_Click:
Msgbox Err.Description
Resume Exit_AddNew_Click

End Sub

Hope help.

Thanks a lot.
Jing

 
Hi!

Try changing acAdd to acFormAdd.

hth
Jeff Bridgham
 
Hi,Jeff

I already try that, still not work.

Thanks
Jing
 
Try this:
Private Sub AddNew_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Make sure you have the correct name of the button.
Hope that somewhat helps!
 
Hi, vz,

It works for MS Access(.mdb) not work for Access Project(.adp). I don't know What's wrong I did.

Any suggestion.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top