473,756 Members | 7,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

display textbox (unbound) in form

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_AfterUpda te()
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
5 2721
On Tue, 26 Sep 2006 22:57:41 -0400, "luanhoxung "
<lu********@yah oo.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_AfterUpda te()
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
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_AfterUpda te()
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
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_AfterUpda te()
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
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
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","Micro soft 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.conn ectiontimeout=0 and connection.comm andtimeout=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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2251
by: Hasanain F. Esmail | last post by:
Hi All, I am using A2 for this database. I have a main form with bound fields of FlightNumber and FlightDate I also have a subform. This subform takes details of a passanger along with other details. I also have a textbox called status in subform. When a passanger's details are entered, status value is set to "confirmed", when passanger calls in to reconfirm flight, status value changes to "Reconfirmed", and when passanger calls in to...
1
9627
by: huela | last post by:
Somehow i have to display the recordset in unbound form When i use the following display the data in recordset to unbound form. I have a question: i can only display the last record data, all previous data are overwrittend. why i can't create the continues form or datasheet display the data line by line. Thanks a lot for the help
2
5698
by: Paul .V. | last post by:
I have a report which I call to print from a form. For security reasons I have created a global variable: Const Company = "This Test Company" I call that constant whereever I want the company name to show whether it be a textbox or a label on a form. In this situation I have the unbound textbox on a report which, through VBA calls the constant and assigns it to the textbox.
5
1752
by: sparks | last post by:
After trying a combo box to do this. its tied to a lookup table name value yes 1 no 0 they wanted to be able to type in a 1 but display a yes in the field. and store a 1 in the table. so I set the combo box to
1
2623
by: John Phelan-Cummings | last post by:
When I add the name of a new individual in a, bound form, it will not display that person’s name in a label control of a second unbound form. I have a scheduling program that I am working on. Included in the application program is a data “GRID” which I believe was created using Visual Basic, not standard Access. Its purpose is to display the results of a range of “from-to-dates” of registrations for different clients. The difficulty...
0
3009
by: colleen1980 | last post by:
Hi: There are two textboxs in my main form. One is bound and another is unbound. There is no entry in the unbound textbox as values come into automatically after entering some information in the subform. My question is how to i pass values from unbound textbox to bound textbox every time when the value change in unbound textbox i need to change the value in the bound textbox. When the form load there is already value in the bound textbox...
1
15192
by: dpark29 | last post by:
Access 2000 - If a textbox control is bound to a hyperlink field in an Access database table, the textbox appears formatted as hyperlink and when the user right-clicks the field, the Hyperlink option is available on the resulting popup Shortcut Menu form. I am developing a form that uses unbound textboxes, and I need to include a textbox that will contain a hyperlink. How do I get an unbound textbox to act like a textbox that is bound to a...
6
5312
by: Gilberto | last post by:
Hello I have a table (BOM TOTAL L1 V1) created by a query which only contains one field (TCL1) with ONE record. I've been trying to display this record on a form (either in a textbox or a label) so i can them make some calculations with this number but i CANT!!! I have tried different things and nothing. I get error "#Name?" when entering =! on the unbounded textbox. Should the textbox or label be BOUND??? UNBOUND???
2
1658
by: NerdyGirL | last post by:
Hello, I've read thru numerous post/archives trying to decipher the cause of my problem to no avail. I'm just basically trying to conduct a search by using a form in order to locate data that may or may not be in one field of an associated table/query. Here's my 3-step process. 1) I click on the name of my Main form (that I've already created along with a subform and query and an click-on command button) and it prompts me with an "Enter...
0
9973
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9645
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6473
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5069
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5247
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3276
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.