Form & Subform problems!!

G

Guest

I have a data entry form consisting of one main form (Client List Table) with
three subforms in it (Primary Training Table, Secondary Training Table, and
Employment table). I have everything working but when I click on add new
client, the combo box I created in each subform stays the same. Its like its
not linked to the subforms. Could it be relationship problems?

The combo boxes in the 2 training subforms are linked to a trades tables.
This table has all the info on trades I need for my DB. The combo box in the
employment table is linked to an employer codes table that has all the info
on employers I need for my DB. All the info that is linked to the combo
boxes are already typed in the tables i linked them to.

Any suggestions??
 
G

Guest

Are the sub forms updating at all, is it just the combo boxes that do not
update? You could try requerying the combo boxes after the button is clicked.
 
G

Guest

All the subforms are updating except for the combo boxes, I tried linking a
query based on the tables linking the combo boxes but it still won't update.
 
G

Guest

at the end of the code used for the buton to create a new record - after the
create newrecord part of the code add something like

Forms!NameOfForm!NameOfSubform!combo.requery

this is where
NameOfForm = name of your main form
NameOfSubform = Name of your sub form
Combo = the name fo the combo to be requried

you will need to write this for each subfrom
 
G

Guest

I used a macro for the "Create New Client" button.

The macro says "Client from macros.CreateNewClient : On click(Macro Name)
GoToRecord(Action)
 
G

Guest

I am sorry but i have never used the macros extensively (only to save as a
module to understand what it is doing)


You could try going to the on click event in the properties window, remove
the name of the macro, then click on the 3 dots to the side and select code
builder romt here you can try pasting in this code

DoCmd.GoToRecord , , acNewRec
This will be pasted between the part that says private sub ****_onclick
and the part that says end sub
 
G

Guest

I am sorry but i have never used the macros extensively (only to save as a
module to understand what it is doing)


You could try going to the on click event in the properties window, remove
the name of the macro, then click on the 3 dots to the side and select code
builder romt here you can try pasting in this code

DoCmd.GoToRecord , , acNewRec
This will be pasted between the part that says private sub ****_onclick
and the part that says end sub


if you are uncertain about doing this make sure to take a copy of your
database first so you can play around with it
 
G

Guest

Should I make a new query with all the fields in the query and try and run
the code again or should that matter? Because my query only has the fields I
want the user to see...
 
G

Guest

Nope that shouldnt make any difference. Are the combo boxes actually bound to
the record source for the subforms in anyway?
 

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