Data Input Question

T

TeeSee

I have a single form supplied by a query based on an underlying table.
All I want to do is have someone input a lot of data and I'm trying to
make it as simple as possible. There are three fields to input.
The first field I made unbound, the next two I are bound to the table
thru the query. In the first field the data will be a part number eg
ACSMSEP1604. The alpha part will be common to all records so I
intended to have the user input the numerical part of the number only.
There is a fourth unbound control on the form with the control source
of ="ACSMSEP " & [ctlItemCode] which gives me the entire code. How do
I get that value into the field in my table named txtSISitemCode at
the same time that the bound controls update the table?
Or is there a better way to do this? Thanks again
 
A

Arvin Meyer [MVP]

TeeSee said:
I have a single form supplied by a query based on an underlying table.
All I want to do is have someone input a lot of data and I'm trying to
make it as simple as possible. There are three fields to input.
The first field I made unbound, the next two I are bound to the table
thru the query. In the first field the data will be a part number eg
ACSMSEP1604. The alpha part will be common to all records so I
intended to have the user input the numerical part of the number only.
There is a fourth unbound control on the form with the control source
of ="ACSMSEP " & [ctlItemCode] which gives me the entire code. How do
I get that value into the field in my table named txtSISitemCode at
the same time that the bound controls update the table?
Or is there a better way to do this? Thanks again


You don't need all the bound/unbound stuff. In the afterupdate event of the
textbox, use a bit of code like:

Sub ctlItemCode_AfterUpdate()
Me.ctlItemCode="ACSMSEP " & [ctlItemCode]
End Sub

Train your users to delete the "ACSMSEP " in the textbox if ther want to go
back and edit the part number. Otherwise they'll wind up with:

"ACSMSEP ""ACSMSEP " & [ctlItemCode]
 
T

TeeSee

I have a single form supplied by a query based on an underlying table.
All I want to do is have someone input a lot of data and I'm trying to
make it as simple as possible. There are three fields to input.
The first field I made unbound, the next two I are bound to the table
thru the query. In the first field the data will be a part number eg
ACSMSEP1604. The alpha part will be common to all records so I
intended to have the user input the numerical part of the number only.
There is a fourth unbound control on the form with the control source
of ="ACSMSEP " & [ctlItemCode] which gives me the entire code. How do
I get that value into the field in my table named txtSISitemCode at
the same time that the bound controls update the table?
Or is there a better way to do this? Thanks again

You don't need all the bound/unbound stuff. In the afterupdate event of the
textbox, use a bit of code like:

Sub ctlItemCode_AfterUpdate()
    Me.ctlItemCode="ACSMSEP " & [ctlItemCode]
End Sub

Train your users to delete the "ACSMSEP " in the textbox if ther want to go
back and edit the part number. Otherwise they'll wind up with:

"ACSMSEP ""ACSMSEP " & [ctlItemCode]

Thanks Arvin ... That was too simple or maybe I'm too simple. Would
like to ask just one more question relating to timing.

When you tab out of the last control on a form I would think that is
when the AfterUpdate event fires. What is the next sequence of
programmable events following that up to the form waiting for the
first field input for next record?

Thanks again
 
A

Arvin Meyer [MVP]

Thanks Arvin ... That was too simple or maybe I'm too simple. Would
like to ask just one more question relating to timing.

When you tab out of the last control on a form I would think that is
when the AfterUpdate event fires. What is the next sequence of
programmable events following that up to the form waiting for the
first field input for next record?
===================
There are 2 AfterUpdate events, the first being after you update a control,
and the second after you update the record. The form's Current event happens
when you start a new record.
 

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