Solved

I need assistance with a grid or datasheet in Access 2013

Posted on 2014-12-14
2
523 Views
Last Modified: 2014-12-21
Hi Experts,
I have an ACCESS 2013 application. The application has a one to many relationship between the Job table (tblJob) and JobVenues table (tblJobVenues).

tblJob has the following fields:
JobID  (Primary Key - Auto Generate)
JobName
COntactName
ContactPhone
ContactEmail

tblJobVenues has the following fields:
JobVenueID (Primary Key - Auto Generate)
JobID (Foreign Key that links it to tblJob)
VenueName
Address1
Address2
City
State
Zip

I want my form to display the Job information, with it's related venues in a some sort of grid.
How do I do this?  Do I use a sub form, a form in Datasheet View, or something else?

I have attached a sample of what I want to accomplish to this post.  Thanks in advance.
Sample of grid
I tried the following code and it failed:
Subform Error
mrotor
0
Comment
Question by:mainrotor
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40500031
1. Create a Form based on tblJob.
2. Create a second Form based on tblJobVenues. That form should be a Datasheet form.
3. With the first form open in Design view, drag the second form and drop it on the first form. This will create your subform.
4. On the first form, set the Master and Child link fields to be JobID for both.

Don't add code to set the Recordsource, or anything of that nature. Access will handle the relationships via the Master and Child link process.

Regarding your error: That generally means you are not correctly referring to the Subform. Note that Access names that object differently depending on how you add the Subform.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 40500387
It is a good idea to give controls meaningful names, using the standard LNC (Leszynski Naming Convention) prefixes, to avoid confusion when reading code.  This convention is given in many books, and in my Wikipedia article on this topic:

http://en.wikipedia.org/wiki/Leszynski_naming_convention
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question