View Single Post
  #5 (permalink)  
Old May 31st, 2005, 07:03 AM
rjweers rjweers is offline
Friend of Wrox
 
Join Date: Nov 2004
Location: Seattle, WA, .
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

I think this is one where you're going to have to hack through mostly on your own. But here's a little code that will do what you asked.

For the TextfieldA_AfterUpdate event, write something to the effect of:
Code:
' make sure the form is open
If CurrentProject.AllForms("formname").IsLoaded Then
    ' make sure we should populate the text field
    If isnull(Forms("formname").TextfieldB) then
        Forms("formname").TextfieldB = Me.TextfieldA
    End If
End If
The trouble is, there probably is a lot of code that needs to go into checking to be sure Form B is ready to receive the data from Form A. Questions like "has the user changed the data on Form B and should it be saved before we send data from From A?" have to be asked.

Without knowing more about how your users are using the forms (e.g. are the forms strickly data entry (new records), or will they use Form A to initiate a lookup and do you want to have form B automatically show information related to form A) and why you have chosen to use two forms instead of master and sub (child) form, there's really not much I can do other than tell you the code that will do what you asked which was to "auto-populate the data from form A to form B".
Reply With Quote