I don't know why I am having an issue with this, especially when I helped someone the other day.
Four fields in the table tblFTPLOGIN:
txtServerList
txtFolder
txtUID
txtPWD
The unbound form has a combo box called txtServerChoice , listing txtServerList from the table. I want to post txtFolder from the table to an unbound box txt on form frmForm. -
txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "[txtServerList]" = Forms![frmForm]![txtServerChoice])
-
This does not work either -
txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = " & Forms![frmForm]![txtServerChoice])
-
The thing does not work...frustrat ing
3 6587 Denburt 1,356
Recognized Expert Top Contributor
Try this: -
txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
-
Or an easier possibly quicker or faster(for MS Access) method would be to list the txtfolder alongside the txtserverlist in the combobox and reference it like so:
me!txt1 = me!txtServerCho ice.column(2)
Try this: -
txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
-
Or an easier possibly quicker or faster(for MS Access) method would be to list the txtfolder alongside the txtserverlist in the combobox and reference it like so:
me!txt1 = me!txtServerCho ice.column(2)
Denburt...that worked great!. -
txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
-
Can you throw me a quick note why that worked?:)
Denburt 1,356
Recognized Expert Top Contributor
Denburt...that worked great!. -
txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
-
Can you throw me a quick note why that worked?:)
Yes I would be glad to.
When using text in criteria you have to wrap it in quotes, a number type you don't, so your example would be fine if it was a number but since it was text, you needed to add an extra set of quotes:
txtServerList = "MyText"
So since your wrapping the expression in quotes already you need to essentially double wrap or use single quotes (the way I did). I hope that was clear.
Glad it's working if you need anything else (more examples etc.) let me know.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Knud Rogilds |
last post by:
I have tried everything, what am I doing wrong?
I have a data entry form in datasheet view (for mass data entry). One of the
fields are SalesID, and I would like to use DLookup to populate an unbound
field next to it, just for information for the data entry person.
I use:
strFilter = "SalesRefID = " & Me!Salesid
Me!Salesnavn = DLookup("SalesName", "SalesIDs", strFilter)
|
by: Zlatko Matiæ |
last post by:
There is a form (single form) and a combobox. I want that current record of
the form is adjusted according to selected value in the combobox. Cuurrent
record should be the same as the value in the combobox.
What is the solution?
Thank you in advance.
|
by: MLH |
last post by:
DLookup("", "tblPreliminaryVINs",
"=Forms!frmVINODO!SerialNum")
is giving me a Type Mismatch error. That's confusing to me
and I don't know how to circumvent it. The field in
tblPreliminaryVINs is a 17-char text field. Forms!frmVINODO!SerialNum
is just an unbound textbox on a form (frmVINODO).
I run the DLookup during the textbox's BeforeUpdate event code. Some
VIN values I type in there do NOT give rise to the error. Some do. By
|
by: TerryD |
last post by:
I have a form that has an unbound text field that I am using DLookup in to display the values from a Temp Table. My program calls for me pushing a button to print a report, which runs a query first that overwrites the data in the "Temp Table" that this DLookup is pulling from. Once I have printed the report and return back to the main form the value in the unbound text field with the DLookup still shows the data from the Temp Table that was...
|
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...
| |
by: Parasyke |
last post by:
I have a form (I won't bore you with the details of the necessity of
this, but), I need to have a textbox that uses DLookup to get a value
from a table with both being keyed to a common field "DMSID".
Because of various issues I need to get the textbox to simply display
the "PICTUREPATH" stored in the "PicturePaths" table based on another
value present on my form.
I'd like to use something like:...
|
by: aharding |
last post by:
Hello!
I am using Access 2003
I have been playing with DLookup all morning and have not been successful yet. I have never used this function...and have some limited experience with code. I will post what I have tried so far and hopefully someone can help me problem solve.
I have tried three different methods... (I know Calculation is spelled wrong..I have to go through my database and fix it everywhere just haven't had the time...
|
by: Richard |
last post by:
How is the result of query placed in a unbound textbox ?
Suppose
CriteriaLookups has columns TableName, KeyColumn, KeyValue,
DataColumn
Foo,x,11,xhat
Bar,z,3,xyzzy
And
|
by: rleepac |
last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue
This is a table used to assign an Age Correction value to hearing test results - since some degree of hearing loss naturally occurs with aging - OSHA lets us calculate that in before determining if the employee has an actual "significant" hearing loss.
Anyway...I have my...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |