473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Dlookup - Place value in an unbound textbox

Nathan H
104 100+
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.

Expand|Select|Wrap|Line Numbers
  1. txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "[txtServerList]" = Forms![frmForm]![txtServerChoice])
  2.  

This does not work either
Expand|Select|Wrap|Line Numbers
  1. txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = " & Forms![frmForm]![txtServerChoice])
  2.  
The thing does not work...frustrating
Dec 21 '07 #1
3 6545
Denburt
1,356 Expert 1GB
Try this:

Expand|Select|Wrap|Line Numbers
  1. txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
  2.  
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)
Dec 21 '07 #2
Nathan H
104 100+
Try this:

Expand|Select|Wrap|Line Numbers
  1. txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
  2.  
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!.

Expand|Select|Wrap|Line Numbers
  1. txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
  2.  
Can you throw me a quick note why that worked?:)
Dec 21 '07 #3
Denburt
1,356 Expert 1GB
Denburt...that worked great!.

Expand|Select|Wrap|Line Numbers
  1. txt1.Value = DLookup("[txtFolder]", "tblFTPLOGIN", "txtServerList = '" & Forms![frmForm]![txtServerChoice] & "'")
  2.  
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.
Dec 21 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
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...
8
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...
11
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...
1
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...
0
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...
1
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...
1
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...
3
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
15
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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...
0
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,...
0
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...
0
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...

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.