Subform problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,


Hopefully this will be a simple one.


I have two tables (a master table and a child table) with a one to many
relationship. I want to create a form that allows me to enter data into
the master table. That's no problem. I can do that.


The master table has records transactions at a number of stores. The
child data contains 2 fields: the name of each store and the regional
manager's name. Each RM manages several stores.


On the form I'm trying to create I want to enter the store name via a
drop down box (I can get that far) but then I want that data to trigger
a subform(?) which automatically brings up the regional manager's name
via a link to the child table.


Sounds simple enough but after several hours of trial an error I can't
do it. The subform usually remains blank and will not respond to changing
the store selection in the drop down box.
Any help would be appreciated.


Thanks, YYY
 
Hi,

If you only want to display the regional manager's name could the
recordsource for your
combobox (cboStoreName) be a query returning two fields - the store name and
the manager's name,
the store name will be displayed in column 0, the manager's name will be in
column 1 with
a column width of 0.

Then you'd have an unbound textbox and the control source would be
=cboStoreName.column(1)

HTH -Linda
 
Hi,

I followed what you suggested. Actually I did it several times, each time
starting from scratch. But unfortunately each time was without success.

I created the combo box (in my case I called it cboProgramName) setting the
columns as you suggested. That part worked. I then used the toolbox to create
an unbounded text box and brought up the properties box for that. In the
Control Source space I put in "=cboProgramName.column(1)" (without quotes of
course).

Two things happened:
1. After clicking out of the control source box I got an error message
stating "Microsoft Access can't find the name 'cboProgramName' you entered in
the expression.
2. The following text appears in the unbounded text box : #Name?

So I'm baffled. Any help would be greatly appreciated.

Thanks again,
David
 
Hi,

I've just gone through the exercise myself, a combobox (cboname) with two
columns (one with width of 0)
and an unbound textbox with the control source set to
=[cboname].[column](1).
Actually I typed in =cboname.column(1) and Access modified it to the value
shown above,
so Access obviously recognized the control name.

I'd say start over. Simplify. A combobox (cboNew) with ONE column. A
textbox with
control source set to =cboNew.column(0)

Let me know how it goes. Sure looks as though the basic problem is that
Access doesn't
recognize the name of your combobox. Possible misspelling?

Linda
 
Hi,

I'm so sorry, but I must be missing something so simple it's embarrassing.
I've just spent the last 90 minutes following your instructions below approx.
6 times and each time in the text box I get the following: #Name?

For the life of my I have no idea what I might be doing wrong. I've even cut
and pasted your field names to be sure I wasn't misspelling. Still no success.

Is this hopeless?

Thanks,
David

Squirrel said:
Hi,

I've just gone through the exercise myself, a combobox (cboname) with two
columns (one with width of 0)
and an unbound textbox with the control source set to
=[cboname].[column](1).
Actually I typed in =cboname.column(1) and Access modified it to the value
shown above,
so Access obviously recognized the control name.

I'd say start over. Simplify. A combobox (cboNew) with ONE column. A
textbox with
control source set to =cboNew.column(0)

Let me know how it goes. Sure looks as though the basic problem is that
Access doesn't
recognize the name of your combobox. Possible misspelling?

Linda



Yeahyeahyeah said:
Hi,

I followed what you suggested. Actually I did it several times, each time
starting from scratch. But unfortunately each time was without success.

I created the combo box (in my case I called it cboProgramName) setting the
columns as you suggested. That part worked. I then used the toolbox to create
an unbounded text box and brought up the properties box for that. In the
Control Source space I put in "=cboProgramName.column(1)" (without quotes of
course).

Two things happened:
1. After clicking out of the control source box I got an error message
stating "Microsoft Access can't find the name 'cboProgramName' you entered in
the expression.
2. The following text appears in the unbounded text box : #Name?

So I'm baffled. Any help would be greatly appreciated.

Thanks again,
David
 
Nope, never hopeless, always another way to get there...

My assumption is that we're working on one form. If you're putting one
control on a form
and the other control on a subform then we'd need to do it differently.

We'll be working on one form now - create a new empty form, save it, name
the form.
Enable the wizard via the wizard button on the design toolbar.
Then put a combobox on the form using the wizard. The recordsource will not
be a table
or query for this test. While working with the wizard select the option
"I will type in the values that I want." Number of columns will be 1. Data
to be entered:
in the column presented enter four rows: data will be: One Two Three Four.
When the wizard is done, go to the properties window for the combobox
and enter the Name for the combobox: let's say cboBox.
Then open the form and ensure that One Two Three and Four are in the
combobox dropdown
list, make sure it's working OK.
Then drag a textbox onto the same form, drop it right beside the combobox.
Its Name doesn't matter; We've been typing in the Control Source but
there's another way
to try instead of that. When you've clicked on the Control Source
line in the properties window you'll see a little button with "..." on it on
the extreme right of that
line. Click that and you can navigate to the combobox control. A dialog
will open.
In column one you'll select Forms -> Loaded Forms -> your form name
(so you must save your form first to name it)
Then in column two doubleclick on the name of your combobox (we're obviously
looking for
cboBox in this list of controls) in order to load the name into the empty
top panel
of this dialog then click OK. (Access will later insert the "=" for you).
You should be looking at
=[cboBox] as the Control Source. And now we're sure that Access will know
this name
because Access put it there.

=[cboBox] will get you by default the data in column 0. There's no need to
state
=[cboBox].[column](0) to get data in column 0. But obviously essential to
state
=[cboBox].[column](1) etc to get data from any other column.

Try this, let me know how it goes.

Linda


Yeahyeahyeah said:
Hi,

I'm so sorry, but I must be missing something so simple it's embarrassing.
I've just spent the last 90 minutes following your instructions below approx.
6 times and each time in the text box I get the following: #Name?

For the life of my I have no idea what I might be doing wrong. I've even cut
and pasted your field names to be sure I wasn't misspelling. Still no success.

Is this hopeless?

Thanks,
David

Squirrel said:
Hi,

I've just gone through the exercise myself, a combobox (cboname) with two
columns (one with width of 0)
and an unbound textbox with the control source set to
=[cboname].[column](1).
Actually I typed in =cboname.column(1) and Access modified it to the value
shown above,
so Access obviously recognized the control name.

I'd say start over. Simplify. A combobox (cboNew) with ONE column. A
textbox with
control source set to =cboNew.column(0)

Let me know how it goes. Sure looks as though the basic problem is that
Access doesn't
recognize the name of your combobox. Possible misspelling?

Linda



Yeahyeahyeah said:
Hi,

I followed what you suggested. Actually I did it several times, each time
starting from scratch. But unfortunately each time was without success.

I created the combo box (in my case I called it cboProgramName)
setting
the
columns as you suggested. That part worked. I then used the toolbox to create
an unbounded text box and brought up the properties box for that. In the
Control Source space I put in "=cboProgramName.column(1)" (without
quotes
of
course).

Two things happened:
1. After clicking out of the control source box I got an error message
stating "Microsoft Access can't find the name 'cboProgramName' you
entered
in
the expression.
2. The following text appears in the unbounded text box : #Name?

So I'm baffled. Any help would be greatly appreciated.

Thanks again,
David

:

Hi,

If you only want to display the regional manager's name could the
recordsource for your
combobox (cboStoreName) be a query returning two fields - the store
name
and
the manager's name,
the store name will be displayed in column 0, the manager's name
will be
in
column 1 with
a column width of 0.

Then you'd have an unbound textbox and the control source would be
=cboStoreName.column(1)

HTH -Linda


Hi,


Hopefully this will be a simple one.


I have two tables (a master table and a child table) with a one to many
relationship. I want to create a form that allows me to enter data into
the master table. That's no problem. I can do that.


The master table has records transactions at a number of stores. The
child data contains 2 fields: the name of each store and the regional
manager's name. Each RM manages several stores.


On the form I'm trying to create I want to enter the store name via a
drop down box (I can get that far) but then I want that data to trigger
a subform(?) which automatically brings up the regional manager's name
via a link to the child table.


Sounds simple enough but after several hours of trial an error I can't
do it. The subform usually remains blank and will not respond to changing
the store selection in the drop down box.
Any help would be appreciated.


Thanks, YYY
 
Back
Top