Form inserting data into wrong field

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

Guest

Hi,
I have a form that has a Combox Box. In this Combo Box I can select a user.
For some reason, when I go back to the Combo Box, it has replaced the user I
selected with another field called Tag. This is a inventory database that I'm
trying to create. I have the Control Souce set to User. Row Source type is
Table/Query. Row Source is SELECT tblPCs.Tag, tblPCs.User FROM tblPCs ORDER
BY tblPCs.User; Column Count is 2. Column Widths is 0";1". Can anybody help
me resolve this.

Thanks
 
Which column is the bound column. If it is bound to column 1, then it will
store the tag but display the user (with the column widths you have
specified).
 
When I try to bound to colum 2, I receive the following error: rs.FindFirst
"[Tag] = " & Str(Nz(Me![Combo103], 0))

Thanks
 
It is not quite clear what you are trying to save here. Are you trying the
save the Tag# or the User? The query you provided would save the Tag# but
display the user. Is this what you want?

There are problems with getting the correct display when trying to bind to
anything but column 1. Try binding to column 1, ensuring that this is the
value that identifies the record you want, and then displaying both column1
and column2 if you want to. You may have to change the row source to reverse
the order of the columns.

Also, you must have some code running in the AfterUpdate of the combo box
that navigates to the record (thus the FindFirst). Also, the syntax of your
FindFirst below would indicate that Tag is numeric but you are attempting to
compare it to a string (Str). If Tag is numeric, you probably need this:

"[Tag] = " & Val(Nz(Me![Combo103], 0))

If Tag is a string, you probably need this:

"[Tag] = '" & Str(Nz(Me![Combo103], 0) & "'")

Caryguy said:
When I try to bound to colum 2, I receive the following error: rs.FindFirst
"[Tag] = " & Str(Nz(Me![Combo103], 0))

Thanks


Brian said:
Which column is the bound column. If it is bound to column 1, then it will
store the tag but display the user (with the column widths you have
specified).
 
The combo box should drop down where I can select a user. When I select that
user, all the information about the users computer should fill the form. What
is happening is that when I choose a user now, it is replacing that user with
a tag number.

Thanks

Brian said:
It is not quite clear what you are trying to save here. Are you trying the
save the Tag# or the User? The query you provided would save the Tag# but
display the user. Is this what you want?

There are problems with getting the correct display when trying to bind to
anything but column 1. Try binding to column 1, ensuring that this is the
value that identifies the record you want, and then displaying both column1
and column2 if you want to. You may have to change the row source to reverse
the order of the columns.

Also, you must have some code running in the AfterUpdate of the combo box
that navigates to the record (thus the FindFirst). Also, the syntax of your
FindFirst below would indicate that Tag is numeric but you are attempting to
compare it to a string (Str). If Tag is numeric, you probably need this:

"[Tag] = " & Val(Nz(Me![Combo103], 0))

If Tag is a string, you probably need this:

"[Tag] = '" & Str(Nz(Me![Combo103], 0) & "'")

Caryguy said:
When I try to bound to colum 2, I receive the following error: rs.FindFirst
"[Tag] = " & Str(Nz(Me![Combo103], 0))

Thanks


Brian said:
Which column is the bound column. If it is bound to column 1, then it will
store the tag but display the user (with the column widths you have
specified).

:

Hi,
I have a form that has a Combox Box. In this Combo Box I can select a user.
For some reason, when I go back to the Combo Box, it has replaced the user I
selected with another field called Tag. This is a inventory database that I'm
trying to create. I have the Control Souce set to User. Row Source type is
Table/Query. Row Source is SELECT tblPCs.Tag, tblPCs.User FROM tblPCs ORDER
BY tblPCs.User; Column Count is 2. Column Widths is 0";1". Can anybody help
me resolve this.

Thanks
 
Back
Top