How to make automatically fill

  • Thread starter Santiadji via AccessMonster.com
  • Start date
S

Santiadji via AccessMonster.com

Sorry for re-write this, cause I have been waiting for days but no reply of
it.
I am sorry for not complete description last time. Well, actually
it complicated for me to explain cause I use subform on my form. Let say I
have two table 1st is tblworker and 2nd is tblStock. tblStock is put on the
subform. I put many text box on the subform from tblStock fields, two of it
are BadgeNo & WorkerName. The text box will be used by user to fill data.
Because of I have already tblworker so I want on BadgeNo text box user just
fill her BadgeNo then her name will be appear automatically on the worker
name text box, because if user shall put manual the name, it difficult due to
some user have long and strange name. How to link the badgeno and worker name
text box to tblworker then it will have also on tblStock??

Thankyou...
 
N

news.microsoft.com

The database does not require both ways to identify the worker. Only the key
is required to make the connection. It looks like the key is the BadgeNo, so
I suggest that you use a combo box instead of a text box where the user will
pick the name, and have the BadgeNo actually be bound to the field.
 
S

Santiadji via AccessMonster.com

Yes you are right, but Iif I use combo box the name list will be very long
cause there are around 30 workers as user and every 6 month they usual
changed with new worker, so I think It is better to use text box, can you
help me for this...meanwhile all worker will be update on tbl worker

news.microsoft.com said:
The database does not require both ways to identify the worker. Only the key
is required to make the connection. It looks like the key is the BadgeNo, so
I suggest that you use a combo box instead of a text box where the user will
pick the name, and have the BadgeNo actually be bound to the field.
Sorry for re-write this, cause I have been waiting for days but no reply
of
[quoted text clipped - 16 lines]
Thankyou...
 
A

Arvin Meyer [MVP]

Unless there are many similar names, the length of the list will not matter.
Combo boxes have an AutoExpand property which allows usually typing only 2
or 3 characters before the name is chosen. Even if there are many names that
are similar, adding an ActiveWorker (yes/no) field to tblWorker, will limit
the combobox for you. The RowSource of the combo would be something like:

Select BadgeNo, WorkerName From tblWorker Where Active = True;

Storing a name in addition to the BadgeNo in the second table is very bad
database design and practice because it means repeating data. Even if you
only display it, and don't store it, you have a performance hit when you do
the lookup. I strongly suggest that you don't do it. If you insist, the way
is to do a DLookup in the AfterUpdate event of the BadgeNo

Dim x
x = DLookup("WorkerName", "tblWorker", "BadgeNo = '" & Me.txtBadgeNo"')
Me.txtWorkerName = x
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Santiadji via AccessMonster.com said:
Yes you are right, but Iif I use combo box the name list will be very long
cause there are around 30 workers as user and every 6 month they usual
changed with new worker, so I think It is better to use text box, can you
help me for this...meanwhile all worker will be update on tbl worker

news.microsoft.com said:
The database does not require both ways to identify the worker. Only the
key
is required to make the connection. It looks like the key is the BadgeNo,
so
I suggest that you use a combo box instead of a text box where the user
will
pick the name, and have the BadgeNo actually be bound to the field.
Sorry for re-write this, cause I have been waiting for days but no reply
of
[quoted text clipped - 16 lines]
Thankyou...
 
Top