Senin, 24 Februari 2014

RE: [MS_AccessPros] One table or many?

 

John,

I have two buttons right now.  I will keep it that way.

 

Thanks,

Bill

 

 

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Saturday, February 22, 2014 11:04 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] One table or many?

 

 

Bill-

 

Sorry for the tardy reply.

 

You have two different things you want to do, so you either need to provide two command buttons or one command button and something like an option group where the user can indicate which action he or she wants to do.

 

John Viescas, Author

Microsoft Access 2010 Inside Out

Microsoft Access 2007 Inside Out

Microsoft Access 2003 Inside Out

Building Microsoft Access Applications 

SQL Queries for Mere Mortals 

(Paris, France)

 

 

 

On Feb 19, 2014, at 7:37 PM, Bill Singer <Bill.Singer@at-group.net> wrote:



John, Just one more question on this subject.

 

I have all the common information for all the insurance policies in one table (t_CommonInsInfo) and all the Insurance Type information in separate individual tables.

Records are kept for each renewal year so there will be multiple records for each customer for each Insurance Type but with a different year.

 

From my SubForm on the Main customer page I can view and input the information from the  t_CommonInsInfo.  PK  ComcomID

The button on my Subform has the "Select Case"  language to insure the correct form is opened and the correct records are selected.

 

Here is the sample you provided.

        Case 8

            DoCmd.OpenForm "Health Rates Input Form", WhereCondition:="ComcomID = " & Me.ComcomID

 

This works great for posting a new record.  I start the record in the SubForm and when I hit the button it opens the same record in the new form. ( I save the record before I open the new form.)  Then I can complete the specific information on the second form.  Works perfect.

 

However, there are times when I want to open the new form, for example the "LifeInsuranceInputForm" and see more than the new record, I want to be able to scroll through the history records for the life insurance policies.  So I created a button to do this.

 

  Case 8

             DoCmd.OpenForm "Health Rates Input Form", WhereCondition:="ComCusID = " & Me.ComCusID

 

 

This opens the form and shows all the records related to the Customer  (CusID)

 

This works fine as well.

 

However, now I have two buttons on my sub form.  Is there any way to do both of these statements with one button.

 

I know it is a small issue but I thought I would help.

 

Thank you very much for your help.

Bill

MN

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Tuesday, February 18, 2014 2:14 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] One table or many?

 

Great!

John Viescas


Sent from my iPad
On Feb 18, 2014, at 18:48, "Bill Singer" <Bill.Singer@at-group.net> wrote:

John,

I just wanted you to know, I got this to work.   VERY nice.

Bill

MN

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Friday, February 14, 2014 1:56 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] One table or many?

Bill-

 

YES!

 

Private Sub cmdDetails_Click()

 

    Select Case Me.ComTypID

        Case 8

            DoCmd.OpenForm "frmHealthDetails", WhereCondition:="ComcomID = " & Me.ComcomID

        Case 9

            DoCmd.OpenForm "frmLifeDetails", WhereCondition:="ComcomID = " & Me.ComcomID

        Case …

 

 

    End Select

 

End Sub

 

 

John Viescas, Author

Microsoft Access 2010 Inside Out

Microsoft Access 2007 Inside Out

Microsoft Access 2003 Inside Out

Building Microsoft Access Applications 

SQL Queries for Mere Mortals 

(Paris, France)

 

 

 

On Feb 14, 2014, at 3:32 AM, <Bill.Singer@at-group.net> <Bill.Singer@at-group.net> wrote:





John,

I really like this split table idea.  It is going to help me with a summary snap shot for each customer.  I will have a sub form on the main form that just shows the information in the t_CommonInsInfo.  The sub form is going to be in continuous form view.  It will show all the active policies for that specific customer.  The sub form will have a button that a user can click if they want to see additional details of the policy.

The continuous form will have the fields (combo box).

ComcomID - PK field (not visible)

ComTypID - FK to indicate the type of insurance this is.  (Health=8, Life=9, Dental=10..etc.)

ComCarID   - FK to indicate the Insurance carrier.

Plus .. 4 more fields.

The problem is that when the button is clicked and the ComTypID = 8 I want the "Health Details" form to open.   When the button is clicked and the ComTypID = 9 I want the "Life Details" form to open... etc for each type of insurance.

 

Is it possible to have a button open different forms based on the value in a field.  Some type of If..Then statement or Case ..else.

 

Thanks for all you help.

Bill

MN

 

 

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (21)
.

__,_._,___

Tidak ada komentar:

Posting Komentar