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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command button- add new record

Status
Not open for further replies.

Fredgarner

Technical User
Jul 21, 2005
29
GB
On my switcboard I have a command button that allows the user to enter a new transaction on the 'Transactions (by contact)' form. The code reads thus:

Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Transactions (by Contact)"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub

There is only one problem- on the original 'Transactions (by Contact)' Form, there are 2 drop-down list boxes that allow the user to navigate to a specific contact, and then enther a transaction for that contact. However, when my 'add new record' command button is used, the drop-down list boxes, whilst coming up with the correct name in the box when I enter the first few letters, does not navigate to that record when I press 'Return'. In other words,the version of the from being openened by the command button is an incomplete versionof the one I created! If I am being unclear, I would be happy to clarify, because this is a total mystery to me and I would love some help!
 
If you are adding a new record there should be no record there for the combos to navigate to.
Please clarify what you are trying to do here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top