473,406 Members | 2,387 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,406 software developers and data experts.

Link command button to subform

Okay so let me preface this question by saying I am a very competent novice microsoft access 2010 user (I have Msft Access 2010 on my computer). I understand basic access concepts and database setup but that's where it ends so if an answer could be given as if I knew nearly nothing that would be much appreciated.

The issue:

I have an existing database I am trying to build for my landscaping business. I have a main form called "Landscaping Customer Information" that I want to have accompanied by several subforms. I am aware of how to create a subform within a main form and link the primary key to the foreign key, etc.

WHAT I AM STRUGGLING TO FIGURE OUT IS: Instead of having all of these subforms directly on the main form (and instead of having tabs for each of the subforms), how can I add command buttons to open the subforms such that each subform is only opening the data specific to the particular primary key (eg: landscaping customer information ID) AND ALSO auto-fills the specific primary key from the main form into the foreign key field?

Said differently, here's a specific example. Main form is named "Customers". Primary key is set to autonumber and is "Customers Id". One of the subforms is named "Customer tasks completed". Primary Key is set to autonumber and is "customer tasks completed id". Foreign Key is set to number and is "customers id". I would like a command button that opens the subform "customer tasks completed" and depending on which "customers" entry it is opened in, it would autofill that specific "customers id" into the foreign key set as "customers id".

For the life of me I cannot find a solution to this that is both practical and that I understand as a more basic user. Any help is hugely appreciated, thanks in advance!
Jan 23 '17 #1
2 1866
jimatqsi
1,271 Expert 1GB
DoCmd.Openform has a parameter for a where string, so that you can open a form and control the data that is shown in the form's recordset.
Jan 24 '17 #2
Thank you for your reply. Pretend I know nothing. How would I go about implementing this advice step-by-step? I don't have any coding experience.
Jan 26 '17 #3

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

Similar topics

13
by: Samantha Smit | last post by:
Hi, I am trying to create a simple asp page that has one command button that updates a database. The URL of the page is like this: http://MyServer.com/Update.asp?UserName=Tom My asp code is...
1
by: mcena | last post by:
Pls someone help me. I am using a tabstrip control in which I need to use a command button to set focus to a desired tab while on another, without having to click on the tab desired. The visible or...
2
by: moogen | last post by:
Hi Everyone, I need to have a command button placed in a form (that is displaying a customers data) that when pressed will open a new form where I can enter in various information concerning that...
3
by: bagstoper | last post by:
Like the title said i need help making a command button display an image in an image box. i have tried the following: Private Sub Command1_Click() LoadPicture() end sub it gives me a error that...
8
FyrJammer
by: FyrJammer | last post by:
I apologize if there is already a discussion about this, but I don't have a lot of time looking for it. I need to create a command button that opens explorer to search for images to add / put into...
2
by: hitesh bhalkiya | last post by:
i have designed a form . now i need to add a command button or a label in status bar. is there any facility in vb6 that will help me to do so?
5
by: carl2k2 | last post by:
As part of my system, I wanted it so it would add values given in two text boxes together, i only know how to do this in the command button :) Here is my code; LBLxvat.Caption =...
5
by: orajat | last post by:
need to create a command button on html page where when clicked, saves system time in a field, EndTme, of TimeTracker Table in MS access. Pls help with the code. (onclick jscript)
1
by: tymperance | last post by:
I have a 2007 database that I need to add a command button that will open a new Outlook task and allow the user to input the assignment, start date, due date, etc. I've got plenty of code scripting...
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...
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
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
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...

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.