Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / October 2008

Tip: Looking for answers? Try searching our database.

Using the Access button wizard to link forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
avarho - 06 Oct 2008 20:55 GMT
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?
Dale Fye - 06 Oct 2008 21:31 GMT
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.

Signature

HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> 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)
[quoted text clipped - 21 lines]
>
> How do I fix this?
Mike Painter - 06 Oct 2008 22:24 GMT
He must be using 2007 (" I selected the button tool from the ribbon and")
I don't think it uses code in most cases for this but a macro.

> Copy the code that was created by the wizard and post it here.
>
[quoted text clipped - 35 lines]
>>
>> How do I fix this?
avarho - 08 Oct 2008 17:04 GMT
I am using Access 2007.

The code that is comes up is :
"[CaseNo]=" & [CaseNo]

> Copy the code that was created by the wizard and post it here.
>
[quoted text clipped - 32 lines]
> >
> > How do I fix this?
Dale Fye - 08 Oct 2008 18:24 GMT
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.
Signature

HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> I am using Access 2007.
>
[quoted text clipped - 37 lines]
> > >
> > > How do I fix this?
avarho - 08 Oct 2008 18:38 GMT
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

> What is the data type of the [CaseNo] field (string, integer, long integer)?
>
[quoted text clipped - 49 lines]
> > > >
> > > > How do I fix this?
Dale Fye - 08 Oct 2008 18:41 GMT
I don't use macros much, but try changing the Data Mode from Add to Edit.
Signature

HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

> CaseID Datatype is a Long Integer.
>
[quoted text clipped - 61 lines]
> > > > >
> > > > > How do I fix this?
avarho - 08 Oct 2008 20:57 GMT
I tryed to change the data mode and it didn't fix the problem. Is there
anything else you can suggest?

> I don't use macros much, but try changing the Data Mode from Add to Edit.
>
[quoted text clipped - 63 lines]
> > > > > >
> > > > > > How do I fix this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.