O
Open a form with TABS from another form
This is my problem:
I have a form with TABS (formVisitReason) i use to create a record with many
yes/no buttons.
After I create the record, I want to view the record I just created, but
impossible to make it work. The form always comes back blank, even though the
record was created and i can see it in teh database.
Here is teh logic: I open the above form from the visit table, which has a
visitID. Tha visitID is passed to the formvisitreason. This is working like a
charm. But when i want to view what I just created, impossible
visitReasonID is an autonumber from the visit table copied to the
visitreason table. The visitreason form has 2 tabs, but the visitreasonID is
on top of the form. I also used the patientID, the PatientvisitID to no
avail. Maybe it's because te hform if tabbed, because I have no problem with
other forms
----CODE FROM THE VISIT TABLE
I count the number of recs in teh table in a variable NumOfRecs with the
visitID
If NumOfRecs > 0 Then 'VIEW THE RECORD
strWhere = "[VisitReasonID] = " & Me.[VisitReasonID]
DoCmd.OpenForm "frmtbl_VisitReason", WhereCondition:=strWhere
Else 'CREATE NEW RECORD
DoCmd.OpenForm "frmtbl_VisitReason", , , , acFormAdd
endif
I have a form with TABS (formVisitReason) i use to create a record with many
yes/no buttons.
After I create the record, I want to view the record I just created, but
impossible to make it work. The form always comes back blank, even though the
record was created and i can see it in teh database.
Here is teh logic: I open the above form from the visit table, which has a
visitID. Tha visitID is passed to the formvisitreason. This is working like a
charm. But when i want to view what I just created, impossible
visitReasonID is an autonumber from the visit table copied to the
visitreason table. The visitreason form has 2 tabs, but the visitreasonID is
on top of the form. I also used the patientID, the PatientvisitID to no
avail. Maybe it's because te hform if tabbed, because I have no problem with
other forms
----CODE FROM THE VISIT TABLE
I count the number of recs in teh table in a variable NumOfRecs with the
visitID
If NumOfRecs > 0 Then 'VIEW THE RECORD
strWhere = "[VisitReasonID] = " & Me.[VisitReasonID]
DoCmd.OpenForm "frmtbl_VisitReason", WhereCondition:=strWhere
Else 'CREATE NEW RECORD
DoCmd.OpenForm "frmtbl_VisitReason", , , , acFormAdd
endif