Open a form with TABS from another form

  • Thread starter Open a form with TABS from another form
  • Start date
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
 
J

Jeff Boyce

Having "...many yes/no buttons" can sometimes be an indication that the
underlying data is not well-normalized. It all starts with the data.

Please describe your table structure ... it may be that there are other
approaches that multiple yes/no fields, which can be problematic. For
example, if ANOTHER yes/no field is needed, wouldn't your approach require
changing the table, changing related queries, changing related forms,
changing ...?

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Open a form with TABS from another form" <Open a form with TABS from
another (e-mail address removed)> wrote in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top