Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 04-28-2018, 02:21 AM   #1
Simona14
Newly Registered User
 
Join Date: Apr 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Simona14 is on a distinguished road
Autofill textboxes based on combobox value

Hi! I'm trying to populate text boxes based on a text in a combobox. I've tried using a dlookup in the textbox's control source but i can not figure out what i'm doing wrong. The values in the combobox are populated with the table "Persons" Region value.
=DLookUp(“[Name]”,”Persons”,”[Persons].[Region] = “”” & [Combo17].[Text] & “”””)

Simona14 is offline   Reply With Quote
Old 04-28-2018, 02:58 AM   #2
moke123
Me.Dirty=True
 
moke123's Avatar
 
Join Date: Jan 2013
Location: Massachusetts
Posts: 761
Thanks: 3
Thanked 231 Times in 217 Posts
moke123 will become famous soon enough
Re: Autofill textboxes based on combobox value

First thing you should do is change the name of the "Name" field as that is a reserved word.

there are several ways to achieve what you want and a little difficult to understand with so little info.

Does your Dlookup return what you want?
if so you can use it in the after update event of the combo with something like
Me.YourTextBoxName = DLookUp("YourField","YourTable","YourCriteria")
moke123 is offline   Reply With Quote
Old 04-28-2018, 03:54 AM   #3
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,568
Thanks: 68
Thanked 2,744 Times in 2,629 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Autofill textboxes based on combobox value

Is your form bound?
What is the rowsource if combobox?
What is the recordsource of your form?

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 04-28-2018, 07:17 AM   #4
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,262
Thanks: 13
Thanked 4,110 Times in 4,042 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Autofill textboxes based on combobox value

If the values can be included in the combo row source:

http://www.baldyweb.com/Autofill.htm
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 04-29-2018, 07:08 AM   #5
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,243
Thanks: 15
Thanked 1,591 Times in 1,511 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Autofill textboxes based on combobox value

Here's an example that shows how to do this. Look at example 4.
Attached Files
File Type: zip FillFormFields.zip (333.2 KB, 28 views)

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Reply

Tags
combobox to form , dlookup access forms , textbox autofill

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill text box based on Combobox selection alabk Forms 5 12-12-2012 06:08 AM
Autofill ComboBox based on another Combo mumbles10 Forms 6 03-24-2011 04:57 AM
autofill textboxes jlabre01 Forms 2 06-02-2008 05:42 AM
Autofill text box based on three combobox selections johho0ha Forms 6 07-08-2007 10:51 PM
Autofilling Textboxes with Table data based on a Combobox. Ross Hurrell General 7 11-21-2006 02:54 AM




All times are GMT -8. The time now is 04:30 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World