Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending or getting data between forms

Status
Not open for further replies.

kazprog

Programmer
Jan 28, 2004
11
GB
Please does anybody know about picking up data from a previous form or sending data to a new form. I have tried the method of altering the control source for the item to be =forms![formname]![fieldname]
I have also sent the data when the form is being opened in the Event procedure with a docmd openform and then it populates a field on the new form with a field on the current form in the VB code.

The problem I am having is to populate a field on the next form that has a subform and also has any three forms opening it. So I have to choose which form to populate from. It is a field on that subform that I am having problems populating. I have tried the usual steps above and I have also tried the Isloaded without success.
I have also tried populating the form that the subform is on and on the before insert stage on the subform, setting the field in question to this value. When I try to do this it either says I can't assign a zero length string or I need to define the field with a property set or property get. I have never used these before.

If anybody knows more than me (very probable) please could they point me in the right direction
Thanks
 
Hi,

there are a couple of ways to do this, you can pass arguments to a form you open from another form (look up openargs in help) you should be able to cascade these openargs as you open your other forms. using open args means that it doesnt matter which form your opening from.

or you can raise events in an open form that another open form can listen out for and act upon, i.e. to keep 2 forms in sync(I wont go into that unless you want me to as it will take a bit of time...)

HTH, Jamie
[deejay]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top