Two subforms for the same table

R

RuralGuy

Justified ended up being single form
Tabulated - Continuous Forms

I had refered to tabulated and justified in reference to form Wizard.
Sorry for the confusion. Now I will know.

Good. That is how I have been think of them. :)
 
A

alexasha

The strategy sounds great. I have double check my spelling and it is correct.
But I am still getting
Enter parameter value
Medication_Tabular.Form.AutoID_med

Do we need to change our continuous forms properties?
 
R

RuralGuy

The strategy sounds great. I have double check my spelling and it is
correct. But I am still getting
Enter parameter value
Medication_Tabular.Form.AutoID_med

Do we need to change our continuous forms properties?

You have verified the following:

If the name of the Field in the <medications> table is AutoID_med then
change the name of the TextBox that is bound to it to txtAutoID_med. That
will eliminate any confusion. If you do that you will need to change both
the Master and Child text.

What is the name of the actual SubForm by the way; not the SubFormControl?
 
A

alexasha

Still
Medication_Tabular
Medication_justified
I have renamed my text box in both forms to txtAutoID_med (both label and
text box), but control source is still AutoID_Med
Now I am getting parameter enter for both
Medication_Tabular.Form.txtAutoID_med
and
txtAutoID_med
 
R

RuralGuy

The strategy sounds great. I have double check my spelling and it is
correct. But I am still getting
Enter parameter value
Medication_Tabular.Form.AutoID_med

Do we need to change our continuous forms properties?

I just did some testing on one of my systems with results similat to yours.
Let's go the other way. Put a TextBox on the Main Form and make in
invisible and let's call it txtLink. Make the Control Source of this
TextBox:
=[Medication_Tabular].[Form].[AutoID_med]

Come to think of it, let's leave txtLink visible for now to watch it. It
should change when you select a different record in Medication_Tabular.

Set the Medication_justified to:

Link Child Fields = AutoID_med
Link Master Fields = txtLink

See what that does. I just tried it on my system and it works. Of course
I have different names for thinks.
 
A

alexasha

Ok, I did not get any errors this time.
BUT, prior to this change I was able to browse through records in Justified
table by clicking next/prev buttons and one of the records from Tabulated
subform was visible in my justified subform.
Now I do not have any data in Justified from, but I see all the data in
Tabulated subform.
There is no data in txtLink in main form
Attempt to add data in Justified Subform resulted in error
TheLinkMasterFields property produced this error: 'The object does't contain
the Automation object txtLink
.."



RuralGuy said:
The strategy sounds great. I have double check my spelling and it is
correct. But I am still getting
Enter parameter value
Medication_Tabular.Form.AutoID_med

Do we need to change our continuous forms properties?

I just did some testing on one of my systems with results similat to yours.
Let's go the other way. Put a TextBox on the Main Form and make in
invisible and let's call it txtLink. Make the Control Source of this
TextBox:
=[Medication_Tabular].[Form].[AutoID_med]

Come to think of it, let's leave txtLink visible for now to watch it. It
should change when you select a different record in Medication_Tabular.

Set the Medication_justified to:

Link Child Fields = AutoID_med
Link Master Fields = txtLink

See what that does. I just tried it on my system and it works. Of course
I have different names for thinks.
 
R

RuralGuy

Ok, I did not get any errors this time.
BUT, prior to this change I was able to browse through records in
Justified table by clicking next/prev buttons and one of the records
from Tabulated subform was visible in my justified subform.
Now I do not have any data in Justified from, but I see all the data in
Tabulated subform.
There is no data in txtLink in main form
Attempt to add data in Justified Subform resulted in error
TheLinkMasterFields property produced this error: 'The object does't
contain the Automation object txtLink
."

Well we have at least two problems left. The txtLink TextBox needs to show
the AutoNumber field from the <medications> table record that is current in
your Medication_Tabular SubForm. And we have to get the Link Master Fields
to work. One at a time.

What *exactly* do you have as the Control Source of txtLink?

Select several records in the Tabular SubForm to determine if txtLink will
display something.
 
A

alexasha

In normal view txtLink has #Name?
Control source has =Medication_Tabular.Form.AutoID_med (copied exactly as
you has typed, but square bracked disappeared. I have tried it several times)
Clicking on record in tabular form does not produce any changes in txtLink
value. SO, I guess that might be a problem
 
R

RuralGuy

=?Utf-8?B?YWxleGFzaGE=?= said:
In normal view txtLink has #Name?
Control source has =Medication_Tabular.Form.AutoID_med (copied exactly
as you has typed, but square bracked disappeared. I have tried it
several times) Clicking on record in tabular form does not produce any
changes in txtLink value. SO, I guess that might be a problem

Well it can only be two things: SubFormControlName (Medication_Tabular)
or the the control on the SubForm that is bound to the <AutoID_med> field.

As a diagnostic, let's try displaying some other info from the subform in
txtLink. Any other field will do for this test.
 
R

RuralGuy

Hi alexasha,

Here's a warning from MVP Steve Schapel against having two SubForms based
ofn the same Table/Query. Steve knows his stuff so you may want to rethink
the design.

_____________________________________________________________________
An alternative approach might be to put a hidden control on Form1 to
reference the KeyField from Subform1, and then use this hidden control
as the Link Master Fields property of Subform2.

Mind you, this means that in effect you have 2 subforms both bound to
the same table. I am not sure what the consequences of this could be,
in terms of adding/editing/saving, but I would avoid this arrangement
myself. I would normally use a Zoombox in this type of scenrio. But if
it is really necessary to have the memo field's data shown at all times,
I would probably be tempted to put the memo field in a separate table,
related 1:1 to the Subform1 table.
--
Steve Schapel, Microsoft Access MVP
_________________________________________________________________________

We can still get this working after putting in so much time on it! After
it is working you can decide. :)
 
A

alexasha

No, it looks like neither fields are working. I have tried several.
What is Zoombox? I guess I will play with my design and then go to tab
control.
Thank you for the help.
 
R

RuralGuy

No, it looks like neither fields are working. I have tried several.
What is Zoombox? I guess I will play with my design and then go to tab
control.
Thank you for the help.

I hate to give up this early. Is there a chance you could strip out any
personal sensitive data from the tables and zip up your db and email it to
me? [email protected] without any "-" is my addy.

You have really got my curiosity aroused.
 
A

alexasha

Thank you for the help. Email is on the way. This database is in preliminary
phase and does not contain any sensitive data. Thanks
 
R

RuralGuy

Thank you for the help. Email is on the way. This database is in
preliminary phase and does not contain any sensitive data. Thanks

Got it! I'll let you know asap!
 
R

RuralGuy

Hi alexasha,

On its way back to you!

Tab 3 now works! There were a couple of problems.

Medication_Tabular SubFormControl was named "Medication" - changed
AutoID_med TextBox was named the same as the bound field - renamed to
txtAutoID_med

It works as I would have expected but you may want to revise the idea some.
:)

Thanks for giving me a chance to fix it. It is difficult at best to see
what is going on through your finger tips.
 
R

RuralGuy

Hi alexasha,

I also turned off the Name AutoCorrect which is responsible for many a
corruption. I also turned on Compact on Close.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top