Hello.
I am having a tough time filtering my form. There are two forms in question here: frmMenuDataEdit and frmFacilityEdit. I am trying to open frmFacilityEdit (with data) to a record selected on frmMenuDataEdit.
On frmMenuDataEdit, I have a combo box based on a query that pulls three fields from linking tables together. These three fields are the unique identifiers to each audit (facilityID, date, typeID). No two audits will have the same facility, date, and type. So, I created a query to make this combo box in order to select the audit I wanted to work with. Facility and Type have lookup tables and the query grabs their string names.
I used the same concept on my Reports Menu. There is a combo box on my menu (based on the same query mentioned above), and when a button is pressed to run the report, it passes the AuditID selected in the combo box to the report. It works perfectly.
I decided I wanted to do the same thing with my data edit menu, select an audit, and open FORMS to edit the info (versus the previous setup where you had to cycle through ALL audits to find the one you wanted).
So the code I used to pass the AuditID into frmFacilityEdit is this:
Code:
--------------------------------------------------------------------------------
Private Sub cmdOpenFacilityDataEdit_Click()
Dim stDocName As String
stDocName = "frmFacilityEdit"
DoCmd.OpenForm stDocName, acNormal, , "[AuditID] = " & Me.cmbAuditSelectorEdit
DoCmd.Close
End Sub
--------------------------------------------------------------------------------
I'm getting an error though that says:
Run-time error '3008'
The table 'tblFacility' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically.
I've researched this error and found a few cases like mine, all without any solution.
Does anyone have any idea?!?!
Thanks!!!!
I am having a tough time filtering my form. There are two forms in question here: frmMenuDataEdit and frmFacilityEdit. I am trying to open frmFacilityEdit (with data) to a record selected on frmMenuDataEdit.
On frmMenuDataEdit, I have a combo box based on a query that pulls three fields from linking tables together. These three fields are the unique identifiers to each audit (facilityID, date, typeID). No two audits will have the same facility, date, and type. So, I created a query to make this combo box in order to select the audit I wanted to work with. Facility and Type have lookup tables and the query grabs their string names.
I used the same concept on my Reports Menu. There is a combo box on my menu (based on the same query mentioned above), and when a button is pressed to run the report, it passes the AuditID selected in the combo box to the report. It works perfectly.
I decided I wanted to do the same thing with my data edit menu, select an audit, and open FORMS to edit the info (versus the previous setup where you had to cycle through ALL audits to find the one you wanted).
So the code I used to pass the AuditID into frmFacilityEdit is this:
Code:
--------------------------------------------------------------------------------
Private Sub cmdOpenFacilityDataEdit_Click()
Dim stDocName As String
stDocName = "frmFacilityEdit"
DoCmd.OpenForm stDocName, acNormal, , "[AuditID] = " & Me.cmbAuditSelectorEdit
DoCmd.Close
End Sub
--------------------------------------------------------------------------------
I'm getting an error though that says:
Run-time error '3008'
The table 'tblFacility' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically.
I've researched this error and found a few cases like mine, all without any solution.
Does anyone have any idea?!?!
Thanks!!!!