Forward Data

mshirwan

Registered User.
Local time
Today, 07:35
Joined
Jul 25, 2004
Messages
20
What is the best way to forward data from one form to the next and then to the next, i am currently doing it by saving the data into user defined data types, but my worry is it might not work when i go into a multi user usage.

I am saving userid, amd customerid and supplier id, into variables and set them in the order form by evaluating fields into those variables.

any ideas?
 
I use a hidden form. Memory variables can loose their value if certain errors occur.

The nice feature about the hidden form method is that it is easy to have it be visible if you need it for debugging.
 
More details please

That is interesting, how does that hidden form work
 
What is the best way to forward data from one form to the next and then to the next,

Well, ... technically you don't do this. Before you (and everyone else) goes nuts, let me clarify. You don't usually forward data to another form. You let the other form reach BACKWARDS (NOT FORWARDS) to get the data it wants. This sounds like a nit-pick, but the idea is to get the right mind-set in order to design it correctly. Algorithmically, you want the thing that needs the data to get the data for itself or decide to ask for it.

Oh, you COULD use a hidden form (as Pat suggests) and actively store data in it for later use. And yes, it would work. But the mind set is probably better if you take the other approach - reach BACKWARDS to something that already exists. Usually easier to design, IMHO.

my worry is it might not work when i go into a multi user usage.

There, I can help. Access is not shared among users. Its FILES are shared, but the workspace exists inside each individual user's machine. In particular, the collection of open forms on your instance of Access has nothing to do (other than sharing the base document files) with other simultaneous users of Access. Now, table and object-modification locks are an exception to that statement, but in general, you and everyone else can have different forms or the same forms open, no problem as long as you get the locks right.

Having said that, your problem of getting data (reaching forwards OR backwards) THROUGH OPEN FORMS experiences no problems of confusion, because nobody but you can easily "see" what forms you have open at the moment UNLESS YOU PROGRAM THIS ABILITY INTO THE DB YOURSELF. If you don't do that, each collection of open forms is private.

So, for example, if you want to have form grab information from another form, the syntax is (roughly speaking)

Me.BoxA = Workspace(0).Forms("PersonSelect").BoxA

or something like that. You can look up stuff in the Help files about referencing a control on another form. That's how you would do it. You would have to assume that the other form is open when you use the reference.

Pat's going to suggest that you create a hidden form which you open at startup time or when you open a primary form that will need to pass data. I'll let her explain how that works. But it is an example of dropping a note in one form for another form to pick up later if it needs it, using cross-form references which you should look up in the help files no matter which way she suggests you go with it.
 
I tend to use the hidden form to hold login information. I can't use CurrentUser because I don't use Access security and I don't want to get the network id because multiple people may use the same PC. The login form defaults to the network user but it can be overwritten.

The other place I use the hidden form is when I have forms that may be opened from multiple other forms. It this case, the open form cannot "reach backward" easily since it needs to know which form opened it. So rather than pass data around with the OpenArgs parameter, I use the hidden form.
 
It does work

I think I developed so much of the project to change it. but on a positive note it does work on a multi user usage as i tested it.

thanks for the responds guys
 

Users who are viewing this thread

Back
Top Bottom