Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Record source default (Access 2000)

    I have a form where i must change the record sources.
    In one case the record source is StrOffers and in the other two cases the record source is Bas. In the

    OnOpen event i have put Me.RecordSource = Bas, however, when i have changed the record source to

    Stroffers, it stays here on opening of the form.
    Here is the code that handles the choice of the Recordsource:

    Private Function FncCust()
    If Me![ChkID] = True Then
    Me.RecordSource = Bas
    FncMonths ("USysrptMonthsCustomer")
    ElseIf Me![ChkOffers] = True Then
    Me.RecordSource = StrOffers
    Me![ChkID] = False
    FncMonthsOffers ("RMOnthsOffers")
    Else
    Me.RecordSource = Bas
    Me![ChkID] = False
    Me![ChkID] = False
    FncMonths ("RMonths")
    End If
    End Function

    May be the code is too complicated and i need some help.
    How can i make the form foolproof for me, so that to clear of the previous commands i have done for the

    choice of the products?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Record source default (Access 2000)

    What is the error message you get? What is the value of StrOffers and Bas? Without knowing that, it's hard to give advice.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Record source default (Access 2000)

    <hr>however, when i have changed the record source to Stroffers, it stays here on opening of the form.<hr>
    What does this mean? Do you mean you've changed the recordsource property in the property sheet or in code? Whatever you set in the property sheet will stay there unless you save the change to another source in code. Or do you mean that your code never sets the recordsource to Bas? Are StrOffers and Bas tables or queries or variables?

    In looking at your code, it does not appear that you have handled the situation where both checkboxes are true. As a result, if both checkboxes are true, your recordsource will always be set to Bas. Is that what you want?
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •