Linking A Form

singingshiver

Registered User.
Local time
Today, 06:16
Joined
Jul 23, 2002
Messages
51
I have a form that I would like to link to another form. Basically, i want to click a button and for the data I require to be copied to the new form.
How do i do this?
 
Hi there..

With the button you create an "OpenForm" event, and use the wizard to guide you - it's easy.

Let the fields in the new form use the old form as a datasource. Use the propety for each field and in the datasource you write:

=Forms![old-form-name].[name-of-field-in-old-form]

Good luck.
Søren
 
=SFI [SFI].[SFI Reference]

I am stuck. What I have added to the control source is above. Any ideas?
 
You appear to have missed out the exclamation mark following the word "Forms". As well as that, I think this workd should be enclosed in square brackets.
[Forms]![formname ]![controlname]
The error message "#Name" appearing in a control indicates the data source has not been defined properly
 
Last edited:
Without actually having tried it myself, I think shkrebs suggests you put

Forms![SFI].[Field]

in the source of the corresponding fields in the new form. For each field you do this.

Fuga.
 
Basically, i want to click a button and for the data I require to be copied to the new form.

Basically, you have two problems. Let's separate them.

Part I - the button that opens another form. As has been pointed out, this is easy. Build the "another form" and store it so that it's name is visible (even if hidden) in the forms pane of the DB window. Use the query wizard to do the command button to open the report. Easy. From your later remarks, you got that far.

Part II - copying data to the new form.

Now you have opened Pandora's Box. If the new form is bound to a table, then opening it isn't enough. You need to either (a) point it to the right record or (b) create a new record based on data from the old form that opened the new one.

In case (a) you must modify the search criteria of the new form before you open it. In case (b) you must have the new form reach back to the old form to gather data.

I think we can assume that you got past stage I. Can you perhaps amplify (just a LITTLE bit) on the direction you need to go for part II of the problem? The answers you would get differ between the two options.
 
I have just tried =SFI! [SFI].[SFI Reference] and still getting the same problem
 
Thank you DOC_MAN.

I am indeed past part 1 and i now require part 2 a. I need the button to copy specific data (SFI Ref, CBUK, GPMS, Prob Desc, Clear Desc) to the new form that it opens. I have created the new form with the text boxes ready. the problem I have is copying the data accross.
 
Have you checked the spelling and so on...

In that case I don´t know. Sorry:(

Fuga.
 
Hi shing...

As The Doc said - if U could provide us with a little more info... :)

Ie.

1) Have U created the new form based on a tabel / a query or what?

2) Do your button work? Does it open the new form?

3) What ver. of Access are U using?

4) As Dave wrote #Name means Access can't find the field you are looking for. Try to write the line like this:
=forms!your-form-name.your-field-name
Access will put all the [] around the names when you are leaving the SourceControle field, if they are correct ;)

Regards
Søren
 
Thanks for the reply.

I ahve tried the code you supplied but i am still getting #Name?

I have created a form from design. the button does work on the exisitng and link to the new form. I am using Access 97.
 
When the wizard asked you what to base your form on, did you select a table or a query?

Fuga.
 
Hmm, in this case I would try to make two new test-forms. 1 with 1 field and a button, and the other with only 1 field.
Give the fields name like FIELD1 etc. etc. just to keep is simple. Then see if U can make it work there. If it's working you have some mess in your names of your forms / fields.

C'mon back and fight :D

Søren
 

Users who are viewing this thread

Back
Top Bottom