viewing info in subforms

N

Natasha

Hi

I am still having problems with this, i am desprate to get it fixed can
anyone help see below for details.
Thanks

Natasha


When i open the form it automatically goes to a new record which is blank.
I select Company the company details show up, this information is on the main
form. ( If that company already has coolers i want this information also to
come up at the moment it doesn't.) so i put the cooler information in for the
new cooler and add the record. At the botomof the form on the left there are
nav buttons to scroll through existing records, when i scroll back over
existing records i get company information and the information on all the
coolers that are in that company. My problem is i can't get this information
on a new record and i want to. I hope this explains it properly. Thanks


Right there was code telling the form to open on a new record, i did that coz
i wanted that to happen, i have taken it away. Now when opening the form
the first record shows up. Say its Customer1 with address1 and phone no1 ect
on the main form and cooler1 info in the subform. Say i want to add a new
cooler to customer7 and customer7 already has 3 coolers. If i select
customer7 from the companyname combo box address7, phone no7 ect go into the
fields automatically fine. Cooler 1 info remains in the subform. I want
cooler7 info to automatically show in the subform at the same time as the
address7 and phone7 info shows and then i want to be able to add the new
cooler info in the subform. I need to be able to see the existing coolers
before i add a new one. I know its a problem between the main form and the
subform but i don't know what it is.
 
S

Steve Schapel

Natasha,

Here's my question...
You say "I select customer7 from the companyname combo box". Is the
companyname combobox bound? I.e. if you look at the Properties of the
companyname combobox in design view of the form, what does it say in the
Control Source property?
 
N

Natasha

Hi Steve

Yes the combo box is bound the controlsource field says CustomerID, which is
the field the connects the main form with the subform. I have looked at the
Northwind example and the example in the Access 2003 Bible and they both do
the same thing as mine in their order forms. If you select a customer from
the combo box the details will change in the main form but they don't change
in the subform.

Natasha
 
N

Natasha

Is there anyway of posting it on the web so you could have a look at it. I
tried to put it on our web site but i cant insert it. I'm using dreamweaver.

Natasha
 
S

Steve Schapel

Natasha,
... CustomerID, which is
the field the connects the main form with the subform.

If you look at the Properties of the subform, do the Link Master Fields
and Link Child Fields properties show CustomerID?
... If you select a customer from
the combo box the details will change in the main form but they don't change
in the subform.

I am concerned that you are doing something inappropriate here. If the
customer combobox on the main form is bound, as you say it is, to the
CustomerID field, then this combobox is a data entry control, whereas
you seem to want to use it more for a navigation purpose. Please be
aware that if you change the customer entered in this combobox, you are
not moving to another record in the main form, you are editing the
customer details of the current record.

If the subform is really related to the main form based on the
CustomerID, the display won't be updated until the change to the main
form record is saved. Which you would probably need to do using code,
to get the result you seek - but as I say, I don't think this is the
right way of going about it.

Hope that makes sense.

What is the Record Source of the main form? If it is a query, which it
sounds like, could you post back with the SQL view of the query? Thanks.
 
N

Natasha

Hi Steve

I want the combobox to be for navigation purposes, but it doesn't do that.
The record source for the forms is a table tblservicehist, all the
information is in this table.
Natasha
 
S

Steve Schapel

Natasha,

If you want to use a combobox like this for navigation purposes, it will
need to be an *unbound* combobox.

One way you can do it is like this:
- with the existing combobox, remove the Control Source being CustomerID
- rename the existing combobox, let's say you name it CustFind
- put a textbox on the form, name it CustomerID, and put its Control
Source to CustomerID
- on the After Update event of the unbound combobox, put code like this...

Me.CustomerID.SetFocus
DoCmd.FindRecord Me.CustFind
Me.CustFind = Null
 
N

Natasha

Hi Steve

I did what you said and now the cooler info comes up automatically, but the
company info that came up before automatically on the main form doesn't come
up now.

Natasha
 

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

Similar Threads

Viewing info in the subform 4
Dynamic Naming of Form Button 3
subforms 0
Viewing information in the subform 13
DLookup in Continuous form 0
Subforms 1
Forms & subforms 2
Populate main form from subform record 0

Top