473,396 Members | 1,877 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,396 software developers and data experts.

Using a DropDown Lookup to Populate 2 fields in an Access Query or Form

SueHopson
47 32bit
Hello Everyone!

My EmployeeData tbl contains a field PPID_Data (number field). I am using this field to lookup values from another table called PayPeriods, which contains all the data for the year 2021.

Expand|Select|Wrap|Line Numbers
  1. SELECT PayPeriods.PPID, PayPeriods.PP, PayPeriods.StartDate, PayPeriods.EndDate
  2. FROM PayPeriods
  3. ORDER BY PayPeriods.PP;
  4.  
Expand|Select|Wrap|Line Numbers
  1. PPID    PP    StartDate    EndDate
  2. 1    01 - Week 01    21-Dec-21    27-Dec-20
  3. 2    02 - Week 03    04-Jan-21    10-Jan-21
I am looking for the best way to have the [StartDate] and [EndDate] update on the form, or using a query, when the user selects the PayPeriod [PP] from the dropdown.

I was able to successfully get the unbound field [SDate] to populate on the form using the code below, but could never get the [EDate] to work. I'm sure I'm missing something simple, but would be happy to learn if there is a better way to reference the fields.

Expand|Select|Wrap|Line Numbers
  1. Private Sub PPID_Data_AfterUpdate()
  2. Me.SDUnbound = Me.Combo800.Column(2)
  3. Me.EDUnbound = Me.Combo800.Column(3)
  4. End Sub
Feb 10 '21 #1

✓ answered by MikeTheBike

Hi Sue

Just a thought, is the droplist column count set to 4?

MTB

2 1938
MikeTheBike
639 Expert 512MB
Hi Sue

Just a thought, is the droplist column count set to 4?

MTB
Feb 11 '21 #2
SueHopson
47 32bit
Nope, it hadn't been.
It's always the little things that get overlooked, isn't it? Thanks Mike!
Feb 11 '21 #3

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

Similar topics

2
by: Chand | last post by:
Hello Everyboy I am creating a small scale db with following fields in the table and form for the data entry purpose. Product ID Product Name Manufacturer Location 101 ...
6
by: Brian | last post by:
Hello, Basically, I'm running a query on a form's activation, and I'd like to have the results of the query be placed into other fields on the same form automatically. Does anybody know how...
1
by: tina.boroff | last post by:
I have 3 boxes that essentially use the same code for not in List events (Thank you to David for all of your help on that one). The code opens another form if the user wants to enter data that is...
13
by: Selesti | last post by:
I have written an Access database that our department uses to store and analyze information on particular jobs. Because our company runs on an enormous SQL DB, I thought it would save some time if...
1
by: mrkselm | last post by:
Hi, I am stuck with a problem in MS Access which does not occur in SQL Server and I have been banging my head against the wall for a couple of days now trying to resolve it. Namely, when I...
5
by: lvroye | last post by:
I have a table of about 6000 clients which have unique client numbers. I am creating a data entry form to log contacts with the clients. I want the client information (Name, Sales Rep, phone...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
4
by: ne0nhal0 | last post by:
I don't consider myself as anything more than an Access newbie, so please bear with me if I don't understand some syntax et cetera. Right. Time to jump into the problem. I have a form,...
2
by: mburns | last post by:
Hello all- I was wondering if it is possible to link an Access query or table to a Word document and pull specific information into Word by manually entering a unique identifier, which would then...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.