473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I call up a form based on a field value in my main form?

I have a database about services and installations as well as warranty and
services for a company I run.
The main form is the customer info form. On this I record names, address and
phone numbers. The first field, though, is an autonumber field I use as
customer ID. This is the main identifier so that I can have 2 John Smith's.
I have forms for warranty, service, quotes,referral s etc, all are called up
by using a command button for that form. Each of these forms also have the
Customer ID field, formatted as number but not autonumbering.
If I press he command button for warranty, I get the warranty form, but not
for that customer.

How can I make sure that when I press the command button for the form, it
goes to the right Customer ID number?
Also, if there is no warranty record for that customer yet, I need to be
able to open a blank warranty form.

TIA
Floyd
Nov 13 '05 #1
3 2087
Br
jquest wrote:
I have a database about services and installations as well as
warranty and services for a company I run.
The main form is the customer info form. On this I record names,
address and phone numbers. The first field, though, is an autonumber
field I use as customer ID. This is the main identifier so that I can
have 2 John Smith's. I have forms for warranty, service,
quotes,referral s etc, all are called up by using a command button for
that form. Each of these forms also have the Customer ID field,
formatted as number but not autonumbering.
If I press he command button for warranty, I get the warranty form,
but not for that customer.

How can I make sure that when I press the command button for the
form, it goes to the right Customer ID number?
Also, if there is no warranty record for that customer yet, I need to
be able to open a blank warranty form.

TIA
Floyd


When opening the secondary form specifiy a WHERE clause using the
current ID on the primary form:

eg. DoCmd.OpenForm "frmMyForm" ,,, "[ID] = " & Me![ID]

(Check the syntax in the help.)

You should also set the default value for the ID field on the secondary
form to be the value of the ID from the primary form (ie.
=Forms!frmMyFor m![ID] )... that way new records will be for that ID.

Br@dley
Nov 13 '05 #2
Thank You. It works very well. I have used it to call several different
forms and I am very happy.
Is it possible to double click on the invoice number in a subform that lists
all invoices for that Customer ID and have it refernce both the Customer ID
as the procedure given to me does, and also relates directly to that
particular invoice number.

Again, thank you very much for the help.

Floyd
"Br@dley" <me@o.my> wrote in message
news:c8******** ***********@new s-server.bigpond. net.au...
jquest wrote:
I have a database about services and installations as well as
warranty and services for a company I run.
The main form is the customer info form. On this I record names,
address and phone numbers. The first field, though, is an autonumber
field I use as customer ID. This is the main identifier so that I can
have 2 John Smith's. I have forms for warranty, service,
quotes,referral s etc, all are called up by using a command button for
that form. Each of these forms also have the Customer ID field,
formatted as number but not autonumbering.
If I press he command button for warranty, I get the warranty form,
but not for that customer.

How can I make sure that when I press the command button for the
form, it goes to the right Customer ID number?
Also, if there is no warranty record for that customer yet, I need to
be able to open a blank warranty form.

TIA
Floyd


When opening the secondary form specifiy a WHERE clause using the
current ID on the primary form:

eg. DoCmd.OpenForm "frmMyForm" ,,, "[ID] = " & Me![ID]

(Check the syntax in the help.)

You should also set the default value for the ID field on the secondary
form to be the value of the ID from the primary form (ie.
=Forms!frmMyFor m![ID] )... that way new records will be for that ID.

Br@dley

Nov 13 '05 #3
Br
jquest wrote:
Thank You. It works very well. I have used it to call several
different forms and I am very happy.
Is it possible to double click on the invoice number in a subform
that lists all invoices for that Customer ID and have it refernce
both the Customer ID as the procedure given to me does, and also
relates directly to that particular invoice number.
Yes. Just reference the form/field.

CustID = Forms!frmMainFo rm![ID]

InvoiceID = Forms!frmPopupF orm![SubFormControl].Form![InvoiceID]

Hope that makes sense to you.
Again, thank you very much for the help.

Floyd
Br@dley

"Br@dley" <me@o.my> wrote in message
news:c8******** ***********@new s-server.bigpond. net.au...
jquest wrote:
I have a database about services and installations as well as
warranty and services for a company I run.
The main form is the customer info form. On this I record names,
address and phone numbers. The first field, though, is an autonumber
field I use as customer ID. This is the main identifier so that I
can have 2 John Smith's. I have forms for warranty, service,
quotes,referral s etc, all are called up by using a command button
for that form. Each of these forms also have the Customer ID field,
formatted as number but not autonumbering.
If I press he command button for warranty, I get the warranty form,
but not for that customer.

How can I make sure that when I press the command button for the
form, it goes to the right Customer ID number?
Also, if there is no warranty record for that customer yet, I need
to be able to open a blank warranty form.

TIA
Floyd
When opening the secondary form specifiy a WHERE clause using the
current ID on the primary form:

eg. DoCmd.OpenForm "frmMyForm" ,,, "[ID] = " & Me![ID]

(Check the syntax in the help.)

You should also set the default value for the ID field on the
secondary form to be the value of the ID from the primary form (ie.
=Forms!frmMyFor m![ID] )... that way new records will be for that ID.

Br@dley

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2394
by: Carlos Ribeiro | last post by:
Hello all, I'm posting this to the list with the intention to form a group of people interested in this type of solution. I'm not going to spam the list with it, unless for occasional and relevant announcements. If you're interested, drop me a note. But if for some reason you think that this discussion is fine here at the c.l.py, please let me know. ** LONG POST AHEAD **
9
3322
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text field called . It gets populated based on what the user selects in a field on the sub form (code in the AfterUpdate Event). Here's the issue. If the user deletes a subform record. The field on the main form shows null even if there is a value in the preceding subform record. What I'd like it to do is immediately refresh to
25
10200
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
4
6993
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
9
2302
by: Tony Williams | last post by:
I have two tables 1.tblmonth which holds two fields txtmonth and txtqtrlabel and 2. tblmain which holds a number of fields but in particular a field called txtqtrlabel2. The two tables are linked on txtqtrlabel and txtqtrlabel2. I have a main form based on tblmonth which has a subform based on tblmain, the two forms are also linked on the same fields. The data entered into txtmonth could be "30/09/04" and the txtqtrlabel data would be...
4
3165
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. Tables: (abbreviated) TblDivision DivisionID
2
946
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about making this work...
4
8495
by: crystal | last post by:
I've checked the threads but haven't been able to come up with a solution to my issue. Help...... I have a simple form based on a table. Within the form is a subform that is also, through a Q, based on the same table. The code: Private Sub Select_BeforeUpdate(Cancel As Integer) On Error GoTo resetselect_Err
6
4494
by: CPAccess | last post by:
How do I maintain referential integrity between a main form and a subform, each based upon different (but joined with integrity enforced) table? Here's the situation: I have two tables: tblContracts and tblPayments. tblContracts has an autonumber field called IDKey as its primary key. tblPayments also has an IDKey field (Integer datatype). The two tables are linked in a one-to-many relationship on the field IDKey with referential integrity...
0
7987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8392
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8050
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8264
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5438
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.