RE: Using the Access button wizard to link forms
- From: avarho <avarho@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 8 Oct 2008 10:38:01 -0700
CaseID Datatype is a Long Integer.
It is identifed in the "on click" command as an embedded macro. The commands
in the macro is an openform command with the following instructions
Form Name: EntryForm-Structures
View: Form
Filter Name:
Where Condition: "[CaseNo]=" & [CaseNo]
Data Mode: Add
Window Mode: Normal
"Dale Fye" wrote:
What is the data type of the [CaseNo] field (string, integer, long integer)?.
If it is a string, then the "WHERE" argument of the Openform method should
read something like:
"[CaseNo] = " & chr$(34) & [CaseNo] & chr$(34)
or
"[CaseNo] = '" & [CaseNo] & "'"
What I was really looking for, is what is all the code in the click event of
the command button.
--
HTH
Dale
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
"avarho" wrote:
I am using Access 2007.
The code that is comes up is :
"[CaseNo]=" & [CaseNo]
"Dale Fye" wrote:
Copy the code that was created by the wizard and post it here.
Not that this really matters, but what version of Access are you using?
The line of code that opens your form, should look something like:
docmd.OpenForm "form2", , , "[CaseID] = " & me.[CaseID], , acDialog
if it is missing the criteria, it will just open the form as if you had
opened it from the database window.
--
HTH
Dale
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
"avarho" wrote:
I am having a problem getting the button wizard to open the correct forms. I
have my main form (form 1) that is defined by a Unique Primary (ex. CaseID)
key and it is related in a one-to-many relationship to another form (form 2)
that has a primary key (StructureID) and a foreign key (CaseID). I want to be
able to add a button to form 1 (which displays data on only one record) that
will open form 2 to display only the records that corrospond to the CaseID in
Form 1.
Steps I've followed:
1. In design view on Form 1 I selected the button tool from the ribbon and
created a button on the form.
2. The botton wizard opens and asks what type of operations are to be
performed. I select FORM OPERATIONS and from the next menu I select OPEN FORM.
3. The next menu that appears is two radio button asking the user to select
the option to display all records or to display specific data. I select
DISPLAY SPECIFIC DATA.
4. The next box that appears asks the user to identify the field that
relate. I select CASEID from form 1 and CASEID from Form 2.
5. The next option are just naming the controls. After that it finishes the
wizard and the botton is created.
But my issues is after all of that my forms will not filter for the specific
data. When I select the button it will open a form that display all records
in the table.
How do I fix this?
- Follow-Ups:
- RE: Using the Access button wizard to link forms
- From: Dale Fye
- RE: Using the Access button wizard to link forms
- References:
- Using the Access button wizard to link forms
- From: avarho
- RE: Using the Access button wizard to link forms
- From: Dale Fye
- RE: Using the Access button wizard to link forms
- From: avarho
- RE: Using the Access button wizard to link forms
- From: Dale Fye
- Using the Access button wizard to link forms
- Prev by Date: export form filtered data to excel
- Next by Date: RE: Using the Access button wizard to link forms
- Previous by thread: RE: Using the Access button wizard to link forms
- Next by thread: RE: Using the Access button wizard to link forms
- Index(es):