By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,206 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

display textbox (unbound) in form

P: n/a
hi all!!
i face to a new trouble.
in my form, i have a textbox(unbound) that informs details of product when
i choose the value of combo box(IDPro).
it is ok when i choose the first value of IDPro. but in the second one,
the texbox show as same as first.
here my code.

Private Sub IDPro_AfterUpdate()
DETAIL.Value = DLookup("[PACKING]", "TProducts", IDPro = Me.IDPro)
End Sub

TProducts : table of Products.
PACKING: field of Products table.
DETAIL : a textbox(unbound)of current form.
and my form is continous format.

Pls help !?
thanks in advance.
luan from vietnam

Sep 27 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Tue, 26 Sep 2006 22:57:41 -0400, "luanhoxung"
<lu********@yahoo.comwrote:

It should be:
DETAIL.Value = DLookup("[PACKING]", "TProducts", IDPro = " & Me.IDPro)
(assuming IDPro is a numeric field)

Another elegant solution is to add the Packing field to the dropdown
list, as a hidden column. Then you can set the ControlSource of your
textbox to:
=IDPro.Column(2)
(or whatever number (start at 0) this new column would be)

-Tom.

>hi all!!
i face to a new trouble.
in my form, i have a textbox(unbound) that informs details of product when
i choose the value of combo box(IDPro).
it is ok when i choose the first value of IDPro. but in the second one,
the texbox show as same as first.
here my code.

Private Sub IDPro_AfterUpdate()
DETAIL.Value = DLookup("[PACKING]", "TProducts", IDPro = Me.IDPro)
End Sub

TProducts : table of Products.
PACKING: field of Products table.
DETAIL : a textbox(unbound)of current form.
and my form is continous format.

Pls help !?
thanks in advance.
luan from vietnam
Sep 27 '06 #2

P: n/a
On Tue, 26 Sep 2006 22:57:41 -0400, luanhoxung wrote:
hi all!!
i face to a new trouble.
in my form, i have a textbox(unbound) that informs details of product when
i choose the value of combo box(IDPro).
it is ok when i choose the first value of IDPro. but in the second one,
the texbox show as same as first.
here my code.

Private Sub IDPro_AfterUpdate()
DETAIL.Value = DLookup("[PACKING]", "TProducts", IDPro = Me.IDPro)
End Sub

TProducts : table of Products.
PACKING: field of Products table.
DETAIL : a textbox(unbound)of current form.
and my form is continous format.

Pls help !?
thanks in advance.
luan from vietnam
The where clause portion of the DLookUp must be a string and it's
value must be concatenated into the string.
If [IDPro] is a Number datatype:
=DLookup("[PACKING]", "TProducts", "IDPro = " & Me.IDPro)

If [IDPro] is a Text datatype, then:
=DLookup("[PACKING]", "TProducts", "IDPro = '" & Me.IDPro & "'")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 27 '06 #3

P: n/a
On Tue, 26 Sep 2006 20:36:46 -0700, fredg wrote:
On Tue, 26 Sep 2006 22:57:41 -0400, luanhoxung wrote:
>hi all!!
i face to a new trouble.
in my form, i have a textbox(unbound) that informs details of product when
i choose the value of combo box(IDPro).
it is ok when i choose the first value of IDPro. but in the second one,
the texbox show as same as first.
here my code.

Private Sub IDPro_AfterUpdate()
DETAIL.Value = DLookup("[PACKING]", "TProducts", IDPro = Me.IDPro)
End Sub

TProducts : table of Products.
PACKING: field of Products table.
DETAIL : a textbox(unbound)of current form.
and my form is continous format.

Pls help !?
thanks in advance.
luan from vietnam

The where clause portion of the DLookUp must be a string and it's
value must be concatenated into the string.
If [IDPro] is a Number datatype:
=DLookup("[PACKING]", "TProducts", "IDPro = " & Me.IDPro)

If [IDPro] is a Text datatype, then:
=DLookup("[PACKING]", "TProducts", "IDPro = '" & Me.IDPro & "'")
I meant to add to my previous message ....
How in the world were you able to add a control named "Detail" to your
form.
Detail is the name of a form property (section), and as such, at least
on my version of Access, Access should not permit the naming of a
control with the same name as a form section.
Even though Detail is not listed as a Reserved Access keyword, you
might also be confusing access as to what you are referring to. I
would suggest you change that control name to something else, perhaps
"txtDetails".

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 27 '06 #4

P: n/a
hi !!
Thanks very much.
Buut my problem is the value of textbox control(old) change when the combo
box get the new value.
Any code adding for saving the value of texbox after each value of
combox.
My textbox control(Detail) just show for viewing !!
any help with appreciation.
Luan.

Sep 27 '06 #5

P: n/a
Hello GroupMembers

iam working on a VB Project

I am using a timer function with interval
Timer1.interval=65000

in this timer function,i update the database also.I use updatebusines
function for updating database which i call from timer function.My
Database is SQL Server.

when i run the exe i get an error saying
-2147217871,"[Microsoft][ODBC SQL Server Driver]Timeout
expired","Microsoft OLE DB Provider for ODBC Drivers" in updatebusiness
function"

What could be the reason.please do help me.its very
very......................... urgent.
if possible little code

i wrote connection.connectiontimeout=0 and connection.commandtimeout=0
at the time of connecting to database(i.e. in the SubMain).But this did
not work.

please please do help me.........

regards
parvathi

Sep 27 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.