Controls in forms

franc_5791

New member
Local time
Today, 09:17
Joined
Nov 7, 2008
Messages
6
Hi Ya

This is ma first post.

I have a form with a sub form on it.
The sub form footer has a control and its value is populated at run time.

This value is transferred to a control on the main form

On the main form, based on the value passed, I need to write a If....Then statement block

My problem is that I am unable to access the value that has been passed to the main form.I can see the value in the control of the main form but am unable to pass the value to a variable in the main form

Please help onthis issue as I am living with this problem for the past 6 days!

Best wishes
P
 
Sorry for not being clear

To make it simple.

I have a sub-form on the main form.There is a control on the footer of the sub-form which is the count of records returned against the query.

I am trying to get this value in my VBA code of the main form

I am able to access the other controls in sub-form but using the same syntax I am unable to get the value of the control in the footer of the sub-form.

I need this value for a If...Then condition to give a message to the user if the value is 0 in the control (if o records are returned) that there are no records to match their search criteria.

Regards
P
 
Without actually seeing any of your code I can't be sure but I expect the problem is that the unbound control in the footer of your subform is calculated in some way, and you cannot simply refer to an unbound calculated control like you would any other control; you have to do the calculation again. To really overly simplify, if

SubForm.ControlX = SubForm.ControlY + SubForm.ControlZ

you can't use

MainForm.Control = SubForm.ControlX

even using the correct syntax, you need to use

MainForm.Control = SubForm.ControlY + SubForm.ControlZ
 
Thanks a ton for the quick reply.

I am not entirely sure with what you have said.

I have a control with records found label in the sub-form footer

Now, I need an if condition in the main form code to check the no of rows returned

Please find attached code

Thanks
P
 

Attachments

Users who are viewing this thread

Back
Top Bottom