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!

Hello: I have a 2003 Access databa 1

Status
Not open for further replies.

Dophia

Technical User
Jul 26, 2004
263
CA
Hello: I have a 2003 Access database that I updated to 2013. It contains a form that has a button that opens another form. But for some reason, it will only run once, until I close and reopen the database. The first form is based on a query. Then the button opens another form. Can anyone help with this? It is extremely frustrating and I don't know what else to do.

Private Sub OpenCatDetails_Click()

On Error GoTo Err_OpenCatDetails_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FrmCat"

stLinkCriteria = "[Pound_Sheet_No]=" & "'" & Me![Pound_Sheet_No] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_OpenCatDetails_Click:
Exit Sub

Err_OpenCatDetails_Click:
MsgBox Err.Description
Resume Exit_OpenCatDetails_Click

End Sub


Sophia
 
perhaps your form is open somewhere in the background
try
Code:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FrmCat"

stLinkCriteria = "[Pound_Sheet_No]=" & "'" & Me![Pound_Sheet_No] & "'"
[highlight #FCE94F][i]DoCmd.Close acForm, stDocName  , acSaveNo[/i][/highlight]
DoCmd.OpenForm stDocName, , , stLinkCriteria

 


Hello PWise: That worked great!! Thank you very much for your help!

I just don't understand how it could be open in the background. I checked everywhere part of that code and form over and over, but I guess it doesn't matter now.

Sophia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top