View Full Version : New User - Linking forms


Sylvia Fergusson
09-02-2001, 11:57 AM
I am trying to alter an existing database to suit my requirements. The existing db had a primary form with a link to two sub forms. I have taken the primary form and now have it as a subform of a subform within a form. Problem is I can not get it to open. I get a parameter box asking for a value when given it then states "open the maintenance form using the button on the assets form" this I am trying to do to no avail. Any help greatly appreciated. The following is the code that is used.

Private Sub Maintenance_Click()
On Error GoTo Err_Maintenance_Click
If IsNull(Me![AssetID]) Then
MsgBox "Enter asset information before opening maintenance form."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Maintenance"
End If

Exit_Maintenance_Click:
Exit Sub

Err_Maintenance_Click:
MsgBox Err.Description
Resume Exit_Maintenance_Click
End Sub

GaryC
09-04-2001, 04:39 AM
Sylvia,

Its difficult to know what the problem is - but it sounds like the underlying query for the original form is trying to read a 'value' from another form - which is probably not now open. - Maybee the 'maintenance form' ? Make a note of the field name in the parameter box and then open your form in design view and look at the data source query - see if any filter parameters are looking for the field name you noted above.

If the query is 'filtered' and returns no data - often Access supresses display of the form.

Its a complex problem - hope this helps.

Good luck