Saving info to a table via Form

V

vladi16

I have a table, tblTests, with the following fields: testnumber, rulenumber,
testname, and reference.

I have a form which saves to a table called tbltretests. On the form a have
the above mentioned fields (a few others also). When I choose from the combo
box on testnumber the info from the other three fields pop up automatically
in text boxes (=[testnumber].[column](2), etc). However, only the testnumber
saves to the table. The three fields whose info pops up automatically to the
text boxes will not save to the table and I get a mesage that comes up
saying: "You must enter a value in the tbltretests.rulenumber field". Yes, on
the table I have Required set to yes.

My goal is to be able to have the user choose atestnumber and not have to
worry about making sure he has the correct matchig information that goes with
that test number (rulenumber, rulename, and reference). I am guessing
because I have it coming up in text boxes is the reason it is not saving to
my table. But I need it to....

Any help is appreciated.

Vadi16
 
C

Chegu Tom

The control source for those text boxes does not contain the name of the
field you want to store that info to in the table. It contains your
expression (=[testnumber].[column](2),

Change those text boxes control source to the names of the fields you want
the data to fall in (for example field1, field2 and field3)

In the after update event of your combo box tell Access to write those
values in the proper text boxs

me.field1=[testnumber].[column](2)
me.field2=[testnumber].[column](3)
me.field3=[testnumber].[column](4)


Tom
 
V

vladi16

The values for the fields: testnumber, rulenumber, testname and reference all
come from a table named tbltests. That is where the combo box on the form
draws the information from.
 
V

vladi16

I get changing the control source to the names of the fields... But am a bit
confused on the the next step. I should click on the after update and just
cut and paste those three lines in on the expression builder?

Chegu Tom said:
The control source for those text boxes does not contain the name of the
field you want to store that info to in the table. It contains your
expression (=[testnumber].[column](2),

Change those text boxes control source to the names of the fields you want
the data to fall in (for example field1, field2 and field3)

In the after update event of your combo box tell Access to write those
values in the proper text boxs

me.field1=[testnumber].[column](2)
me.field2=[testnumber].[column](3)
me.field3=[testnumber].[column](4)


Tom


vladi16 said:
I have a table, tblTests, with the following fields: testnumber,
rulenumber,
testname, and reference.

I have a form which saves to a table called tbltretests. On the form a
have
the above mentioned fields (a few others also). When I choose from the
combo
box on testnumber the info from the other three fields pop up
automatically
in text boxes (=[testnumber].[column](2), etc). However, only the
testnumber
saves to the table. The three fields whose info pops up automatically to
the
text boxes will not save to the table and I get a mesage that comes up
saying: "You must enter a value in the tbltretests.rulenumber field". Yes,
on
the table I have Required set to yes.

My goal is to be able to have the user choose atestnumber and not have to
worry about making sure he has the correct matchig information that goes
with
that test number (rulenumber, rulename, and reference). I am guessing
because I have it coming up in text boxes is the reason it is not saving
to
my table. But I need it to....

Any help is appreciated.

Vadi16
 
G

Golfinray

When you right click on the box, go to events, find the afterupdate event and
click the little box out to the right. Choose Start the code builder. Type
those lines in right where the cursor is, save and exit.

vladi16 said:
I get changing the control source to the names of the fields... But am a bit
confused on the the next step. I should click on the after update and just
cut and paste those three lines in on the expression builder?

Chegu Tom said:
The control source for those text boxes does not contain the name of the
field you want to store that info to in the table. It contains your
expression (=[testnumber].[column](2),

Change those text boxes control source to the names of the fields you want
the data to fall in (for example field1, field2 and field3)

In the after update event of your combo box tell Access to write those
values in the proper text boxs

me.field1=[testnumber].[column](2)
me.field2=[testnumber].[column](3)
me.field3=[testnumber].[column](4)


Tom


vladi16 said:
I have a table, tblTests, with the following fields: testnumber,
rulenumber,
testname, and reference.

I have a form which saves to a table called tbltretests. On the form a
have
the above mentioned fields (a few others also). When I choose from the
combo
box on testnumber the info from the other three fields pop up
automatically
in text boxes (=[testnumber].[column](2), etc). However, only the
testnumber
saves to the table. The three fields whose info pops up automatically to
the
text boxes will not save to the table and I get a mesage that comes up
saying: "You must enter a value in the tbltretests.rulenumber field". Yes,
on
the table I have Required set to yes.

My goal is to be able to have the user choose atestnumber and not have to
worry about making sure he has the correct matchig information that goes
with
that test number (rulenumber, rulename, and reference). I am guessing
because I have it coming up in text boxes is the reason it is not saving
to
my table. But I need it to....

Any help is appreciated.

Vadi16
 
V

vladi16

Great!! Thanks.

Golfinray said:
When you right click on the box, go to events, find the afterupdate event and
click the little box out to the right. Choose Start the code builder. Type
those lines in right where the cursor is, save and exit.

vladi16 said:
I get changing the control source to the names of the fields... But am a bit
confused on the the next step. I should click on the after update and just
cut and paste those three lines in on the expression builder?

Chegu Tom said:
The control source for those text boxes does not contain the name of the
field you want to store that info to in the table. It contains your
expression (=[testnumber].[column](2),

Change those text boxes control source to the names of the fields you want
the data to fall in (for example field1, field2 and field3)

In the after update event of your combo box tell Access to write those
values in the proper text boxs

me.field1=[testnumber].[column](2)
me.field2=[testnumber].[column](3)
me.field3=[testnumber].[column](4)


Tom


I have a table, tblTests, with the following fields: testnumber,
rulenumber,
testname, and reference.

I have a form which saves to a table called tbltretests. On the form a
have
the above mentioned fields (a few others also). When I choose from the
combo
box on testnumber the info from the other three fields pop up
automatically
in text boxes (=[testnumber].[column](2), etc). However, only the
testnumber
saves to the table. The three fields whose info pops up automatically to
the
text boxes will not save to the table and I get a mesage that comes up
saying: "You must enter a value in the tbltretests.rulenumber field". Yes,
on
the table I have Required set to yes.

My goal is to be able to have the user choose atestnumber and not have to
worry about making sure he has the correct matchig information that goes
with
that test number (rulenumber, rulename, and reference). I am guessing
because I have it coming up in text boxes is the reason it is not saving
to
my table. But I need it to....

Any help is appreciated.

Vadi16
 

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