Data base help

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

Guest

I think I have run into a wall. I’m building a tool/inventory database where
my employees can check out tools. No where I have run into the wall is when
the person selects a specific tool from the combo box; I need to have the two
other fields populated with info about the specific tool from my tools table.
Field 1: Asset number and field 2: Serial number. For some reason I can not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] = Tables![Products]")
in my control source for that particular filed. I thank you for any help or
direction you can give me.

Todd
 
is the RowSource of your combo box based on the tools table? if so, suggest
you include the Asset number and Serial number fields in the RowSource. you
can set the Width of those two columns to zero (0"), so they don't show in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0), the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup, then
you'll need to fix your criteria. your criteria must look for a ProductName
in the Products table where the ProductName *equals the value of your combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" & [MyComboBox] &
"'")

the above assumes that the ProductName and the combo box value are both Text
data type.

hth
 
Now will this work in a sub form? I can get it to work in a new form but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

tina said:
is the RowSource of your combo box based on the tools table? if so, suggest
you include the Asset number and Serial number fields in the RowSource. you
can set the Width of those two columns to zero (0"), so they don't show in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0), the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup, then
you'll need to fix your criteria. your criteria must look for a ProductName
in the Products table where the ProductName *equals the value of your combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" & [MyComboBox] &
"'")

the above assumes that the ProductName and the combo box value are both Text
data type.

hth


Todd said:
I think I have run into a wall. I'm building a tool/inventory database where
my employees can check out tools. No where I have run into the wall is when
the person selects a specific tool from the combo box; I need to have the two
other fields populated with info about the specific tool from my tools table.
Field 1: Asset number and field 2: Serial number. For some reason I can not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] = Tables![Products]")
in my control source for that particular filed. I thank you for any help or
direction you can give me.

Todd
 
well, which solution are you using - combobox column references? or DLookup?
and which form is the combobox on? which form are the other two controls on?
and what is the name of your subform *control*? (the subform control in the
main form, and the subform object in the database window, may have the same
name or different names. to get the correct name of the subform control, do
the following:
open the main form in design view.
click on the subform (within the main form design view) to select it.
in the Properties box, click on the Other tab, and look at the Name
property.
that's the name of your subform control.)

i need all the above info in order to give you the correct syntax.

hth


Todd said:
Now will this work in a sub form? I can get it to work in a new form but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

tina said:
is the RowSource of your combo box based on the tools table? if so, suggest
you include the Asset number and Serial number fields in the RowSource. you
can set the Width of those two columns to zero (0"), so they don't show in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0), the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup, then
you'll need to fix your criteria. your criteria must look for a ProductName
in the Products table where the ProductName *equals the value of your combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" & [MyComboBox] &
"'")

the above assumes that the ProductName and the combo box value are both Text
data type.

hth


Todd said:
I think I have run into a wall. I'm building a tool/inventory
database
where
my employees can check out tools. No where I have run into the wall
is
when
the person selects a specific tool from the combo box; I need to have
the
two
other fields populated with info about the specific tool from my tools table.
Field 1: Asset number and field 2: Serial number. For some reason I
can
not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] = Tables![Products]")
in my control source for that particular filed. I thank you for any
help
or
direction you can give me.

Todd
 
OK using the combo box method and the combo box and the two other fields are
all located on the sub form. The name of the Form is "Purchase Orders2" and
the subform is "Purchase Orders Subform".

tina said:
well, which solution are you using - combobox column references? or DLookup?
and which form is the combobox on? which form are the other two controls on?
and what is the name of your subform *control*? (the subform control in the
main form, and the subform object in the database window, may have the same
name or different names. to get the correct name of the subform control, do
the following:
open the main form in design view.
click on the subform (within the main form design view) to select it.
in the Properties box, click on the Other tab, and look at the Name
property.
that's the name of your subform control.)

i need all the above info in order to give you the correct syntax.

hth


Todd said:
Now will this work in a sub form? I can get it to work in a new form but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

tina said:
is the RowSource of your combo box based on the tools table? if so, suggest
you include the Asset number and Serial number fields in the RowSource. you
can set the Width of those two columns to zero (0"), so they don't show in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0), the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup, then
you'll need to fix your criteria. your criteria must look for a ProductName
in the Products table where the ProductName *equals the value of your combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" & [MyComboBox] &
"'")

the above assumes that the ProductName and the combo box value are both Text
data type.

hth


I think I have run into a wall. I'm building a tool/inventory database
where
my employees can check out tools. No where I have run into the wall is
when
the person selects a specific tool from the combo box; I need to have the
two
other fields populated with info about the specific tool from my tools
table.
Field 1: Asset number and field 2: Serial number. For some reason I can
not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] =
Tables![Products]")
in my control source for that particular filed. I thank you for any help
or
direction you can give me.

Todd
 
well, when the combo box, and the textbox controls that refer to it, are all
on the same form (in this case, the subform), the standard syntax should
work fine:

=[MyComboBoxName].Column(2)

substitute the correct combo box name and column number, of course.

hth


Todd said:
OK using the combo box method and the combo box and the two other fields are
all located on the sub form. The name of the Form is "Purchase Orders2" and
the subform is "Purchase Orders Subform".

tina said:
well, which solution are you using - combobox column references? or DLookup?
and which form is the combobox on? which form are the other two controls on?
and what is the name of your subform *control*? (the subform control in the
main form, and the subform object in the database window, may have the same
name or different names. to get the correct name of the subform control, do
the following:
open the main form in design view.
click on the subform (within the main form design view) to select it.
in the Properties box, click on the Other tab, and look at the Name
property.
that's the name of your subform control.)

i need all the above info in order to give you the correct syntax.

hth


Todd said:
Now will this work in a sub form? I can get it to work in a new form but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

:

is the RowSource of your combo box based on the tools table? if so, suggest
you include the Asset number and Serial number fields in the
RowSource.
you
can set the Width of those two columns to zero (0"), so they don't
show
in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0), the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup, then
you'll need to fix your criteria. your criteria must look for a ProductName
in the Products table where the ProductName *equals the value of
your
combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" &
[MyComboBox]
&
"'")

the above assumes that the ProductName and the combo box value are
both
Text
data type.

hth


I think I have run into a wall. I'm building a tool/inventory database
where
my employees can check out tools. No where I have run into the
wall
is
when
the person selects a specific tool from the combo box; I need to
have
the
two
other fields populated with info about the specific tool from my tools
table.
Field 1: Asset number and field 2: Serial number. For some
reason I
can
not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] =
Tables![Products]")
in my control source for that particular filed. I thank you for
any
help
or
direction you can give me.

Todd
 
It does work. It helps when you spell the word column right. Tina thanks
for your help on this. I own you one.

tina said:
well, when the combo box, and the textbox controls that refer to it, are all
on the same form (in this case, the subform), the standard syntax should
work fine:

=[MyComboBoxName].Column(2)

substitute the correct combo box name and column number, of course.

hth


Todd said:
OK using the combo box method and the combo box and the two other fields are
all located on the sub form. The name of the Form is "Purchase Orders2" and
the subform is "Purchase Orders Subform".

tina said:
well, which solution are you using - combobox column references? or DLookup?
and which form is the combobox on? which form are the other two controls on?
and what is the name of your subform *control*? (the subform control in the
main form, and the subform object in the database window, may have the same
name or different names. to get the correct name of the subform control, do
the following:
open the main form in design view.
click on the subform (within the main form design view) to select it.
in the Properties box, click on the Other tab, and look at the Name
property.
that's the name of your subform control.)

i need all the above info in order to give you the correct syntax.

hth


Now will this work in a sub form? I can get it to work in a new form but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

:

is the RowSource of your combo box based on the tools table? if so,
suggest
you include the Asset number and Serial number fields in the RowSource.
you
can set the Width of those two columns to zero (0"), so they don't show
in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0), the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup, then
you'll need to fix your criteria. your criteria must look for a
ProductName
in the Products table where the ProductName *equals the value of your
combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" & [MyComboBox]
&
"'")

the above assumes that the ProductName and the combo box value are both
Text
data type.

hth


I think I have run into a wall. I'm building a tool/inventory
database
where
my employees can check out tools. No where I have run into the wall
is
when
the person selects a specific tool from the combo box; I need to have
the
two
other fields populated with info about the specific tool from my tools
table.
Field 1: Asset number and field 2: Serial number. For some reason I
can
not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] =
Tables![Products]")
in my control source for that particular filed. I thank you for any
help
or
direction you can give me.

Todd
 
lol, you're welcome! :)


Todd said:
It does work. It helps when you spell the word column right. Tina thanks
for your help on this. I own you one.

tina said:
well, when the combo box, and the textbox controls that refer to it, are all
on the same form (in this case, the subform), the standard syntax should
work fine:

=[MyComboBoxName].Column(2)

substitute the correct combo box name and column number, of course.

hth


Todd said:
OK using the combo box method and the combo box and the two other
fields
are
all located on the sub form. The name of the Form is "Purchase
Orders2"
and
the subform is "Purchase Orders Subform".

:

well, which solution are you using - combobox column references? or DLookup?
and which form is the combobox on? which form are the other two
controls
on?
and what is the name of your subform *control*? (the subform control
in
the
main form, and the subform object in the database window, may have
the
same
name or different names. to get the correct name of the subform
control,
do
the following:
open the main form in design view.
click on the subform (within the main form design view) to select it.
in the Properties box, click on the Other tab, and look at the Name
property.
that's the name of your subform control.)

i need all the above info in order to give you the correct syntax.

hth


Now will this work in a sub form? I can get it to work in a new
form
but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

:

is the RowSource of your combo box based on the tools table? if so,
suggest
you include the Asset number and Serial number fields in the RowSource.
you
can set the Width of those two columns to zero (0"), so they
don't
show
in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is
(0),
the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a
DLookup,
then
you'll need to fix your criteria. your criteria must look for a
ProductName
in the Products table where the ProductName *equals the value of your
combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" & [MyComboBox]
&
"'")

the above assumes that the ProductName and the combo box value
are
both
Text
data type.

hth


I think I have run into a wall. I'm building a tool/inventory
database
where
my employees can check out tools. No where I have run into
the
wall
is
when
the person selects a specific tool from the combo box; I need
to
have
the
two
other fields populated with info about the specific tool from
my
tools
table.
Field 1: Asset number and field 2: Serial number. For some reason I
can
not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] =
Tables![Products]")
in my control source for that particular filed. I thank you
for
any
help
or
direction you can give me.

Todd
 
Yeah that should be OWE and not own.

tina said:
lol, you're welcome! :)


Todd said:
It does work. It helps when you spell the word column right. Tina thanks
for your help on this. I own you one.

tina said:
well, when the combo box, and the textbox controls that refer to it, are all
on the same form (in this case, the subform), the standard syntax should
work fine:

=[MyComboBoxName].Column(2)

substitute the correct combo box name and column number, of course.

hth


OK using the combo box method and the combo box and the two other fields
are
all located on the sub form. The name of the Form is "Purchase Orders2"
and
the subform is "Purchase Orders Subform".

:

well, which solution are you using - combobox column references? or
DLookup?
and which form is the combobox on? which form are the other two controls
on?
and what is the name of your subform *control*? (the subform control in
the
main form, and the subform object in the database window, may have the
same
name or different names. to get the correct name of the subform control,
do
the following:
open the main form in design view.
click on the subform (within the main form design view) to select it.
in the Properties box, click on the Other tab, and look at the Name
property.
that's the name of your subform control.)

i need all the above info in order to give you the correct syntax.

hth


Now will this work in a sub form? I can get it to work in a new form
but
when I try in a subform all I get are errors in the fields.

Thanks for the help.

:

is the RowSource of your combo box based on the tools table? if so,
suggest
you include the Asset number and Serial number fields in the
RowSource.
you
can set the Width of those two columns to zero (0"), so they don't
show
in
the droplist. but they will still be available to refer to.

having done the above, you can pull the data from the combo box
columns,
instead of using a DLookup() function, as

=[MyComboBox].Column(2)

note: combo box columns are zero-based, so the first column is (0),
the
second column is (1), etc.

btw, if the above isn't helpful, and you do need to use a DLookup,
then
you'll need to fix your criteria. your criteria must look for a
ProductName
in the Products table where the ProductName *equals the value of
your
combo
box, or one of the columns in your combo box*. something like

=DLookup("[SerialNumber]","Products","[ProductName] = '" &
[MyComboBox]
&
"'")

the above assumes that the ProductName and the combo box value are
both
Text
data type.

hth


I think I have run into a wall. I'm building a tool/inventory
database
where
my employees can check out tools. No where I have run into the
wall
is
when
the person selects a specific tool from the combo box; I need to
have
the
two
other fields populated with info about the specific tool from my
tools
table.
Field 1: Asset number and field 2: Serial number. For some
reason I
can
not
get those two fields to populate. Currently I have this
=DLookUp("[SerailNumber]","[Products]","[ProductName] =
Tables![Products]")
in my control source for that particular filed. I thank you for
any
help
or
direction you can give me.

Todd
 

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

field question 2
Populate a Field 3
Problem with my Dlookup 5
DLOOKUP Save to Table 2
Validation of a field 3
dlookup 2
How Can I get this query to work? 3
Report displays numbers, not appropriate categories 10

Back
Top