Trying to get a combo box to auto populate on a subform

C

compostdave

Hi,
I've got a subform into which the users type comments about events they've
attended. The comments are being recorded in tblEventFocus and this works
fine. However I'm trying to add a combo box to the subform which
automatically selects the correct user from the list and records the name in
the AdviserName column in the table (I know my structure isn't the most
efficient but it works the record is required as each user exports data,
emails it to a central location and then its imported into the master
database - long winded but necessary as the team are spread across the uk and
don't always have network access).

I've set up the combo box to source the value from tblAdvisers using SELECT
tblAdvisers.AdviserName FROM tblAdvisers; in the row source. AdviserName is
the primary key in tblAdvisers.

In the other forms which are being used to collect data, the combo boxes
automatically record the adviser name as selected on the menu form. As far as
I can tell I'm using exactly the same function on the subform with this combo
box as I have on all the others (there are 3 other forms which record data
against the adviser name in other tables without having to select the name
each time) however I just can't get the combo box on this subform to auto
populate (I've tried everything I can think of including copying and pasting
the combo boxes across, and trawled the net for suggestions but still can't
get it to work). Any suggestions would be much appreciated.

Thanks in advance

Dave.
 
A

Arvin Meyer [MVP]

Try binding the combo controlsource property to the AdviserName field. For
that Select statement, also make sure the columncount property is 1, and the
columnwidth property is > 0"
 
J

John Spencer

It always helps if you post the code that is (or is not working).

I suspect that you might be attempting to refer to the subform as if it
were a form. When a form is used as a subform, it is not part of the
collection of open forms.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
P

PJ

Hi,
I am encountering exactly the same problem with just 1out of 4 subforms, all
in the same main form and with exactly the same settings for the row source
etc. Where's the bug? I haven't got a clue...
 
C

compostdave

Hi all,

Thanks for your responses - sorry it took a while to get back to you, only
just got the email to tell me they were there.

I did discover what the problem was though - through trial and error (kind
of how I do most things in Access) I re-built the subform and linked all the
child fields I needed storing from both forms. This may not be the best way
to do it but ts working for now - PJ have you tried this approach - or just
linking the child fields in the properties box for the form (the error
ocurred after I'd added a new field to a table to be updated by a subform but
hadn't updated the subform correctly).

Thanks for your help.

Dave
 

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