Linking multiple forms to one record only.

  • Thread starter Thread starter Problems
  • Start date Start date
P

Problems

Hi, I am stuck!

I have created one table (with text, tick boxes, drop down boxes...) and have
created about 8 forms which all relate to different bits of the table.
Basically one form relates to one part of the table and when clicking on a
choice I have created a macro to go to the corresponding form and so one. i.e.
you have the first form asking whether you want to enter a new record and
when clicking on new record it opens up a new form. the new form asks you
whether the record is a Report or File, you tick one of the boxes and that
takes you to another form etc.
Anyway the problem is that it doesn’t enter all information on one record in
the table only as I wish it to do so but on three. You would have the first
question on line 1, the second question on a line 2, the third one on line
and the fourth one on line 3.
This doesn't make sense.

Does anyone have an idea?
 
Hello "Problems".

Problems said:
Hi, I am stuck!

I have created one table (with text, tick boxes, drop down boxes...)
and have created about 8 forms which all relate to different bits of
the table. Basically one form relates to one part of the table and
when clicking on a choice I have created a macro to go to the
corresponding form and so one. i.e. you have the first form asking
whether you want to enter a new record and when clicking on new
record it opens up a new form. the new form asks you whether the
record is a Report or File, you tick one of the boxes and that takes
you to another form etc. Anyway the problem is that it doesn't enter
all information on one record in the table only as I wish it to do so
but on three. You would have the first question on line 1, the second
question on a line 2, the third one on line and the fourth one on
line 3.

Before opening an other form you should save the current record and
pass criteria containing the primary key to the other form using the
WhereCondition argument of the OpenForm method.
Another approach:
It sounds like you want to create something like a "wizard". Why not
do it the microsoft way? Create only one "long" form that contains
multiple pagebreak controls (such that every "page" has the same
hight) and use "< Previous" and "Next >" buttons in the form footer.
You can navigate between the pages using the forms GoToPage method.
This would have the nice effect, that the next page always is
displayed at the same position as the previous one (where the user
has positioned the window) and not at a fixed position (center).
 
Hello,

Thank you for your reply. My brain is certainly not working today as what I
am trying to do is not working.
Could I be a bit more of a pain and bother you some more?

My first form is called FormArchive? and my second form called
FormReportorProjectA
I take it that when you say Save Current Record I go to the FormArchive?
macro and select "Save" as action and do not need to put anything in the
Object Type and Object Name?
Then when you say pass criteria containing the primary key if I go to the
FormArchive? macro and select "open form "as action what do I need to type
down as WhereCondition?

I was thinking of your second option. If I am to create a long form with
multiple page breaks will it still enable me to only see the required data or
will I have to go through every different pages in order to go to the one I
need?

Sorry I am a novice at creating databases as you can see and I think that I
got more than I can chew ....

Thanks again for your help

Wolfgang said:
Hello "Problems".
Hi, I am stuck!
[quoted text clipped - 11 lines]
question on a line 2, the third one on line and the fourth one on
line 3.

Before opening an other form you should save the current record and
pass criteria containing the primary key to the other form using the
WhereCondition argument of the OpenForm method.
Another approach:
It sounds like you want to create something like a "wizard". Why not
do it the microsoft way? Create only one "long" form that contains
multiple pagebreak controls (such that every "page" has the same
hight) and use "< Previous" and "Next >" buttons in the form footer.
You can navigate between the pages using the forms GoToPage method.
This would have the nice effect, that the next page always is
displayed at the same position as the previous one (where the user
has positioned the window) and not at a fixed position (center).
 
Dear Problems.

Problems said:
Hi, I am stuck!

[quoted text clipped - 11 lines]
question on a line 2, the third one on line and the fourth one
on line 3.
Before opening an other form you should save the current record
and pass criteria containing the primary key to the other form
using the WhereCondition argument of the OpenForm method.
Another approach:
It sounds like you want to create something like a "wizard". Why
not do it the microsoft way? Create only one "long" form that
contains multiple pagebreak controls (such that every "page" has
the same hight) and use "< Previous" and "Next >" buttons in the
form footer. You can navigate between the pages using the forms
GoToPage method. This would have the nice effect, that the next
page always is displayed at the same position as the previous
one (where the user has positioned the window) and not at a fixed
position (center).
Thank you for your reply. My brain is certainly not working today
as what I am trying to do is not working.
Could I be a bit more of a pain and bother you some more?

My first form is called FormArchive? and my second form called
FormReportorProjectA I take it that when you say Save Current
Record I go to the FormArchive? macro and select "Save" as action
and do not need to put anything in the Object Type and Object Name?

If this is the macro that opens the form FormReportorProjectA: yes.
This should be done before the OpenForm action and assures, that the
information that is separated into multiple lines can be written to
only one line. The second form then can access the same record.
Then when you say pass criteria containing the primary key if I go
to the FormArchive? macro and select "open form "as action what do
I need to type down as WhereCondition?

Supposed you have a "Number" column to identify the record, type:
="[Number]=" & [Number]
If the primary key is a text column (say "Code"), then type:
="
Code:
=""" & [Code] & """"
[QUOTE]
I was thinking of your second option. If I am to create a long form
with multiple page breaks will it still enable me to only see the
required data or will I have to go through every different pages
in order to go to the one I need?[/QUOTE]

Depending on what the user chooses, you can store a value in the form
(or in the Tag property of a control) by using the SetValue action.
Display the conditions column in the macro editor and check that
to decide whether to "GoToPage" 2 or 3.
[QUOTE]
Sorry I am a novice at creating databases as you can see and I
think that I got more than I can chew ....[/QUOTE]

It's probably easier to do this with VBA than using macros.
Once you know what you're doing, it's fun!
 
Wolfgang said:
Dear Problems.
Hi, I am stuck!

[quoted text clipped - 11 lines]
question on a line 2, the third one on line and the fourth one
on line 3.
Before opening an other form you should save the current record
and pass criteria containing the primary key to the other form [quoted text clipped - 9 lines]
one (where the user has positioned the window) and not at a fixed
position (center).
Thank you for your reply. My brain is certainly not working today
as what I am trying to do is not working.
[quoted text clipped - 4 lines]
Record I go to the FormArchive? macro and select "Save" as action
and do not need to put anything in the Object Type and Object Name?

If this is the macro that opens the form FormReportorProjectA: yes.
This should be done before the OpenForm action and assures, that the
information that is separated into multiple lines can be written to
only one line. The second form then can access the same record.
Then when you say pass criteria containing the primary key if I go
to the FormArchive? macro and select "open form "as action what do
I need to type down as WhereCondition?

Supposed you have a "Number" column to identify the record, type:
="[Number]=" & [Number]
If the primary key is a text column (say "Code"), then type:
="
Code:
=""" & [Code] & """"
[/QUOTE]
Ok I followed till there and now I am a bit lost... Once Again.. I set up my
Primary key as being ID and an autonumber.  What am I meant to put in the
condition?
Sorry I am really slow with Access.
[QUOTE]
Depending on what the user chooses, you can store a value in the form
(or in the Tag property of a control) by using the SetValue action.
Display the conditions column in the macro editor and check that
to decide whether to "GoToPage" 2 or 3.


It's probably easier to do this with VBA than using macros.
Once you know what you're doing, it's fun!
[/QUOTE]
I wish I knew much more about Access and VBA that's for sure

Thanks again for all your help it is really appreciated
 
Dear Problems.

Problems said:
Wolfgang said:
="[Number]=" & [Number]
If the primary key is a text column (say "Code"), then type:
="
Code:
=""" & [Code] & """"[/QUOTE][/QUOTE]
[QUOTE]
Ok I followed till there and now I am a bit lost... Once Again..
I set up my Primary key as being ID and an autonumber.
What am I meant to put in the condition?
Sorry I am really slow with Access.[/QUOTE]

="[ID]=" & [ID]
 
Dear Wolfgang,

Wolfgang said:
Dear Problems.
="[Number]=" & [Number]
If the primary key is a text column (say "Code"), then type:
="
Code:
=""" & [Code] & """"[/QUOTE][/QUOTE]
[QUOTE]
Ok I followed till there and now I am a bit lost... Once Again..
I set up my Primary key as being ID and an autonumber.
What am I meant to put in the condition?
Sorry I am really slow with Access.[/QUOTE]

="[ID]=" & [ID][/QUOTE]

I think I have followed your explanation to the line but now it tells me when
trying to run the macro "
The object doesnt contain the Automation object 'ID' You tried to run a
Visual Basic Procedure to set a property or method for an object. However,
the component doesnt make the property or method available for Automation
Opeations."

To summarise I went to my MacroArchive?
In Action column
Put in first line Save
Then in second line Open Form

In Open Form box I put as Form Name : FormProjectorReportA
Where Condition : ="[ID]=" & [ID]

I opened the form FormArchive and copied the ID text box and pasted it into
the form FormProjectorReportA

I am starting to think I should give up!!
 
Hello "Problems".

Problems said:
Wolfgang said:
="[Number]=" & [Number]
If the primary key is a text column (say "Code"), then type:
="
Code:
=""" & [Code] & """" 
Ok I followed till there and now I am a bit lost... Once Again.
I set up my Primary key as being ID and an autonumber.
What am I meant to put in the condition?
Sorry I am really slow with Access.[/QUOTE] 
="[ID]=" & [ID][/QUOTE][/QUOTE]
[QUOTE]
I think I have followed your explanation to the line but now it
tells me when trying to run the macro
"The object doesnt contain the Automation object 'ID' You tried
to run a Visual Basic Procedure to set a property or method for
an object. However, the component doesnt make the property or
method available for Automation Opeations."

To summarise I went to my MacroArchive?
In Action column
Put in first line Save
Then in second line Open Form

In Open Form box I put as Form Name : FormProjectorReportA
Where Condition : ="[ID]=" & [ID]

I opened the form FormArchive and copied the ID text box and pasted it
into
the form FormProjectorReportA

I am starting to think I should give up!![/QUOTE]

[Kate Bush and Peter Gabriel: "Don't give up!"]

Replace the Save action by RunCommand with argument SaveRecord.
The form "MacroArchive?" should contain the field ID. It should be the
active form when the macro is run. The recordsource of the other form
should also contain a column ID (I thought, it accesses the same record?).
Therfore, it should work.
 
Back
Top