Fields to be updated manually or automatically

L

Liam

Hi. I am not sure if this is possible but I have a from which includes three
fields 2 of which are combo boxes (which are limited to list of options).
Users enter data as normal into these.
What I want to do is introduce another field which would also update the 3
fields mentioned on having data scanned into it so a user can either manually
enter the data or if possible scan in the data into the new field.
The proposed new field would have the following data format:
CN01234D543219320123A00

Combo 1 would accept 01234D if it is on the list.
Combo 2 would update with CN/54321 if on the list
3rd field would be updated with A00

Any ideas?

Thanks in advance,
Liam
 
A

Allen Browne

There's a couple of ways to do this.

One is to create a calculated field in a query instead of storing it in the
table. It's as easy as typing an expression such as:
[F1] & [F2] & [F3]
where you use your own field names in the square brackets.

Another is to use the AfterUpdate event procedure of the combos to assign a
value to the 3rd field.

For details of both approaches, see:
Calculated fields
at:
http://allenbrowne.com/casu-14.html
 
L

Liam

Hi Allen,
Thank you for your help.

I am having a problem with gettiing the following to work as Event procedure
(probably because it is wrong) Can you shed some light please? I need the
Combo boxes named CountryCode/Manufacturing ID and Part No to update when
data is entered into Text box called PPID Otherwise the operator would be
enter data manually into the limited to list Combos..

Private Sub ppid_AfterUpdate()
[CountryCode/Manufacturing ID] = Left([PPID], 2) & "/" & Mid([PPID], 9, 5)
And [Part No] = Mid([PPID], 3, 6)

End Sub



Allen Browne said:
There's a couple of ways to do this.

One is to create a calculated field in a query instead of storing it in the
table. It's as easy as typing an expression such as:
[F1] & [F2] & [F3]
where you use your own field names in the square brackets.

Another is to use the AfterUpdate event procedure of the combos to assign a
value to the 3rd field.

For details of both approaches, see:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Liam said:
Hi. I am not sure if this is possible but I have a from which includes
three
fields 2 of which are combo boxes (which are limited to list of options).
Users enter data as normal into these.
What I want to do is introduce another field which would also update the 3
fields mentioned on having data scanned into it so a user can either
manually
enter the data or if possible scan in the data into the new field.
The proposed new field would have the following data format:
CN01234D543219320123A00

Combo 1 would accept 01234D if it is on the list.
Combo 2 would update with CN/54321 if on the list
3rd field would be updated with A00
 
A

Allen Browne

Did you intend ampersand rather than And?
Or did you intend to assign values to 2 fields?
(I can't tell if it was meant to be 2 lines or 1.)

If might be worth testing of PPID is null:

If Not IsNull(Me.PPID) Then
Me.[CountryCode/Manufacturing ID] = _
Left(Me.[PPID], 2) & "/" & Mid(Me.[PPID], 9, 5)
Me.[Part No] = Mid(Me.[PPID], 3, 6)
End If

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Liam said:
Hi Allen,
Thank you for your help.

I am having a problem with gettiing the following to work as Event
procedure
(probably because it is wrong) Can you shed some light please? I need the
Combo boxes named CountryCode/Manufacturing ID and Part No to update when
data is entered into Text box called PPID Otherwise the operator would be
enter data manually into the limited to list Combos..

Private Sub ppid_AfterUpdate()
[CountryCode/Manufacturing ID] = Left([PPID], 2) & "/" & Mid([PPID], 9, 5)
And [Part No] = Mid([PPID], 3, 6)

End Sub



Allen Browne said:
There's a couple of ways to do this.

One is to create a calculated field in a query instead of storing it in
the
table. It's as easy as typing an expression such as:
[F1] & [F2] & [F3]
where you use your own field names in the square brackets.

Another is to use the AfterUpdate event procedure of the combos to assign
a
value to the 3rd field.

For details of both approaches, see:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

Liam said:
Hi. I am not sure if this is possible but I have a from which includes
three
fields 2 of which are combo boxes (which are limited to list of
options).
Users enter data as normal into these.
What I want to do is introduce another field which would also update
the 3 fields mentioned on having data scanned into it so a user can
either manually enter the data or if possible scan in the data into the
new field. The proposed new field would have the following data format:
CN01234D543219320123A00

Combo 1 would accept 01234D if it is on the list.
Combo 2 would update with CN/54321 if on the list
3rd field would be updated with A00
\
 
L

Liam

Thanks Allen. I was trying to asign values to 2 fields.
You have been a great help.

Allen Browne said:
Did you intend ampersand rather than And?
Or did you intend to assign values to 2 fields?
(I can't tell if it was meant to be 2 lines or 1.)

If might be worth testing of PPID is null:

If Not IsNull(Me.PPID) Then
Me.[CountryCode/Manufacturing ID] = _
Left(Me.[PPID], 2) & "/" & Mid(Me.[PPID], 9, 5)
Me.[Part No] = Mid(Me.[PPID], 3, 6)
End If

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Liam said:
Hi Allen,
Thank you for your help.

I am having a problem with gettiing the following to work as Event
procedure
(probably because it is wrong) Can you shed some light please? I need the
Combo boxes named CountryCode/Manufacturing ID and Part No to update when
data is entered into Text box called PPID Otherwise the operator would be
enter data manually into the limited to list Combos..

Private Sub ppid_AfterUpdate()
[CountryCode/Manufacturing ID] = Left([PPID], 2) & "/" & Mid([PPID], 9, 5)
And [Part No] = Mid([PPID], 3, 6)

End Sub



Allen Browne said:
There's a couple of ways to do this.

One is to create a calculated field in a query instead of storing it in
the
table. It's as easy as typing an expression such as:
[F1] & [F2] & [F3]
where you use your own field names in the square brackets.

Another is to use the AfterUpdate event procedure of the combos to assign
a
value to the 3rd field.

For details of both approaches, see:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

Hi. I am not sure if this is possible but I have a from which includes
three
fields 2 of which are combo boxes (which are limited to list of
options).
Users enter data as normal into these.
What I want to do is introduce another field which would also update
the 3 fields mentioned on having data scanned into it so a user can
either manually enter the data or if possible scan in the data into the
new field. The proposed new field would have the following data format:
CN01234D543219320123A00

Combo 1 would accept 01234D if it is on the list.
Combo 2 would update with CN/54321 if on the list
3rd field would be updated with A00
\
 

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