A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open a form with TABS from another form



 
 
Thread Tools Display Modes
  #1  
Old January 1st, 2010, 11:54 PM posted to microsoft.public.access.forms
Open a form with TABS from another form
external usenet poster
 
Posts: 1
Default 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 am struggling for teh last 3days to make it work. I used strLinkcriteria
and any other possible combinations to no avail
Thank you.

  #2  
Old January 2nd, 2010, 02:40 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default Open a form with TABS from another form

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 wrote in message
...
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 am struggling for teh last 3days to make it work. I used strLinkcriteria
and any other possible combinations to no avail
Thank you.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.