473,473 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Access 2010 - DLoolup Show Results Values in Texbox on its own line multiple columns

gcoaster
117 New Member
Hello Group
what i am trying to occomplish something i cannot find no matter how hard i search! maybe i am not wording it right.

I would like to use DLookup to show results values from a table and display in a unbound textbox on a form. the results from each column in the table need to be on seperate lines, a break if you may. Here is the code I have so far.

Expand|Select|Wrap|Line Numbers
  1. txtKeywords = DLookup("colKeyword", "tblKEYWORDS", "cboCategory = '" & txtcategories & "'")
  2.  

In colKeyword Column In tblKEYWORDS table match what i select in cboCategory Combo drop down box and populate txtcategories textbox on form

What I would like to do is show All colKeyword results in textbox [txtcategories] and display each result on its own line!

example

entry1
entry2
entry3
entry4


Thank you for your time
Mar 27 '14 #1
4 1570
Seth Schrock
2,965 Recognized Expert Specialist
I'm a little confused by your question. Are you doing multiple DLookups and you want the results from each to be on a separate line? DLookup can only return a single value, but it sounds like you only have one DLookup. If you are doing multiple DLookups, then you might try using a recordset instead as domain functions (DLookup, Dcount, etc.) are resource intensive and can slow your program down with excessive use.

So, no matter how you are getting the different lines of information (or entries from your example), the way to put them are their own line is to concatenate the vbCrLf constant into the string. Something like this:
Expand|Select|Wrap|Line Numbers
  1. Me.txtCategories = "Entry 1" & vbCrLf & "Entry 2" & vbCrLf & "Entry 3"
  2.  
  3. Produces...
  4.  
  5. Entry 1
  6. Entry 2
  7. Entry 3
So the question now becomes how are you getting your bits of entry information.
Mar 27 '14 #2
gcoaster
117 New Member
Hello Seth,
Thank you for your time.

I guess I am trying to do a =DLookup to pull out a columns data in a table that matches a particular category and populate a unbound textbox on a form - each value on its own line.

For instance if I select "Bytes" from combobox
then the dlookup would show me all of the entries in the table that have the category "Bytes" and then populate the textbox.

result would be in the txtbox

Database Geniuses
access databases
Database Heroes



Thank You
Mar 27 '14 #3
Seth Schrock
2,965 Recognized Expert Specialist
DLookup cannot pull an entire column that matches your criteria. It will only return the value in the field specified for the first record that it finds that does match your criteria. It sounds like you would benefit from using a recordset and then looping through it to add the different records into the textbox. Then again, it may be simpler to just use a subform, unless there is a reason that you need all your data in one textbox (which won't allow edits to be saved).
Mar 27 '14 #4
gcoaster
117 New Member
Thanks Seth, Now i understand DLookup
Dont need a subform, no need to edit the data. Nothing is simple in Access!

Ok, A recordset and then looping through it
Mar 27 '14 #5

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

Similar topics

1
by: Angel Pacheco | last post by:
How do I make my results from my program to show 6 values each line? int main() { int counter; counter = 100; while (counter <= 150) { cout << counter << endl; counter =...
17
by: M0ji | last post by:
I have started creating a database (There is only one table as of now). The database is meant to store information about "technical requirements" in an industry. Each row corresponds to one...
1
by: FAJACOBS | last post by:
Hi all, I am attempting to use Access 2010 to split out a single cell with multiple variable data points. For example it may contain There may be up to 7 entries, with quantities, but where there is...
3
by: time2hike | last post by:
Hi, I have a query that pulls in hours for multiple Subprojects by Month and Year. To be able to compare data I need to Count the Month & Year for each subproject. Example Subproject1 11/2011 would...
4
by: RedGoldPhoenix | last post by:
Hi I wish to migrate DDL from DB2 to ACCESS 2010 So I delete "CREATE DATABASE" , "CREATE TABLESPACE" change " FOR SBCS DATA NOT NULL," in " NOT NULL," Delete line which contains "SET CURRENT"...
1
by: jdks2006 | last post by:
I work with a company who is needing to use Access 2010 to receipt in checks for paid invoices. Our issue came when our auditor found we had duplicate receipt numbers using serial numbered receipt...
4
by: vbissues | last post by:
I am trying to understand how to write VB code in Access 2010 to automatically populate the data into multiple excel spreadsheets. The data in the query encompasses all the data (by manager), but I...
9
gcoaster
by: gcoaster | last post by:
Hello Group I need help, I need to use an to show results values from a table and display in a unbound textbox on a form. the results from each column in the table need to be on seperate...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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...
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...
1
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...
0
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...
0
muto222
php
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.