Open Forms

  • Thread starter Thread starter Ruben
  • Start date Start date
R

Ruben

Hi, I have a form which display info about Measurement
Devices all info comming from tblMeasurementDevices.
There's a second form frmDeviceDocumentation from
tblDeviceDocumentation. There's a one to many relationship
between tblMeasurementDevices & tblDeviceDocumentation.

I'm using the following code in a cmdButton at
frmMeasurementDevices

DoCmd.OpenForm "frmDeviceDocumentation", acNormal, , strSQL

Where strSQL = "[MDID] Like " & Me!MDID

Who can I make that if there's no match for the MDID when
opening frmDeviceDocumentation the MDID is set to the same
value from the one side of the relationship?

thx.
 
Using code you can us an sql statement to count the
number of records from the second table prior to opening
the form. If there are records there then open the form,
else do not.

HTH

Byron
 
Back
Top