[mso] Re: Access Form Help

  • From: "Doug Gay" <sneakersdg@xxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 4 Jan 2010 16:37:48 -0600

Hi Herbert

Say you have FormA with text box, txtA and FormB with text box, txtB.

Create a Command Button with the Button Wizard, select form operations and 
Open Form. Of course select FormB to open. The following code will be 
generated.



Private Sub CmdA_Click()

On Error GoTo Err_CmdA_Click

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "FormB"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_CmdA_Click:

Exit Sub

Err_CmdA_Click:

MsgBox Err.Description

Resume Exit_CmdA_Click


End Sub



Now open FormB for design and create the following for the Activate Event:

Private Sub Form_Activate()

'copy content of txtA from FormA to txtB of this form

Me.txtB = Forms![FormA]![txtA]

End Sub

This is the general idea...

Thanks and Luck,

Doug

----- Original Message ----- 
From: "Herbert Chitate" <hchitate@xxxxxxxxxxx>
To: "MSO Group" <mso@xxxxxxxxxxxxx>
Sent: Monday, January 04, 2010 1:27 PM
Subject: [mso] Access Form Help


>
> Hi Folks,
>
>
>
> I was wondering if someone could help me with a form issue in access.  I 
> have a form that does the usual i.e. edit, delet add new record etc. I 
> would like to place a button on this form which opens up another form 
> (populating a differet table). I would like for some of the fields on this 
> newly opened form to be automatically populated from the contents of the 
> firrst form.
>
>
>
> Could anyone help me with the code that I can attach to an event 
> procedure?
>
>
>
> The above way of opening the form is only one of the methods to open the 
> second form. I would also like a user to be able to open the form directly 
> (i.e. not from an initial form) and manually type in in the information.
>
>
>
> Could you also advise the best place to put the event procedure so that 
> the above two methods of opening the form do not conflict.
>
>
>
> Many Thanks
>
>
>
> Herbert
>
>
> _________________________________________________________________
> View your other email accounts from your Hotmail inbox. Add them now.
> http://clk.atdmt.com/UKM/go/186394592/direct/01/
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, visit the group's homepage and use the 
> dropdown menu at the top.  This will allow you to unsubscribe your email 
> address or change your email settings to digest or vacation (no mail).
> //www.freelists.org/webpage/mso
>
> To be able to share files with the group, you must join our Yahoo sister 
> group.  This group will not allow for posting of emails, but will allow 
> you to join and share problem files, templates, etc.: 
> http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for 
> FILE SHARING ONLY.
>
> If you are using Outlook and you see a lot of unnecessary code in your 
> email messages, read these instructions that explain why and how to fix 
> it:
> http://personal-computer-tutor.com/abc3/v28/greg28.htm
> *************************************************************
> 

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to share files with the group, you must join our Yahoo sister group. 
 This group will not allow for posting of emails, but will allow you to join 
and share problem files, templates, etc.:  
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE 
SHARING ONLY.

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: