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...frustrating
3 6545
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!txtServerChoice.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!txtServerChoice.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...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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |