Completing field on subform from command button on main form

L

LDMueller

This is a simplistic version of what I need to do. I have a form named
frmCLIENT with a subform named sfFAMILY. On the form frmCLIENT I have a
command butten and when I press it I want it to automatically complete a
field named CHILDREN on the subform sfFAMILY with the word "NONE".

Can anyone help me.

Thanks,

LDMueller
 
E

Evi

The code for the button is
Me.YourSubformName.Form.Children = "None"
Me.YourSubformName.Form.Children.Requery
'so that you can see the results

This assumes that the subform has only 1 record or that the record you want
editing, is the first one in the subform.
If you want this to occur in another record in the subform, then click on
that record before pressing the button.


You need the word Form in between the subform's name and the control (field)
in the subform.
Check that you know the name of your subform. It may not be the name in the
Database Window. In Design view of the main form, click on the Subform,
Click on Properities and click on the Other tab. If it doesn't have the same
Name as it has in the database window, I usually change the name here in
Properties. Saves confusion.
Evi
 
L

LDMueller

Thank you so much for your detailed response. This was exactly what I needed.

I do have one problem though, it works beautifully on my computer, but when
my users go into Access from their computer the linked fields appear to be
empty.

Have you ever heard of this happening?

Thanks,

LDMueller
 

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