Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting up forms (Access 2K)

    I am sorry to post such dumb questions, but I get so frustrated with Access. Setting up tables is a doddle; making the forms do what I want them to seems impossible (to me that is)
    I am trying to write a database to deal with club membership. I want a form with a field into which the secretary can type a membership number; I want the following behaviours.
    <UL><LI>On entry I want the form to be empty ie all fields blank.
    <LI>When a membership number is typed in, if the number maps on to a member who is already in the DB, I want the data to be put in the fields (so it can be amended if necessary).
    <LI>If the membership number is not recognised, I want the form to remain blank so the details of the new member can be captured and a new record produced.[/list]As things stand at the moment, I have a form which has a membership no field as a combo box bound to the MembershipDetail table which is supposed to go to the record corresponding to the membership number (produced using the toolbox 'add a combo box' wizard).
    On entry, the form displays the details of the first record in the MembershipDetail table - but not the membership number.
    I cannot produce (I have tried, believe me I have tried) the Visual Basic to clear each field if the membership number is not in the list (via the Not in List event procedure)
    If I set the Data Entry attribute for the form, the form appears with all fields blank, but when when a membership number is entered, it errors 'No current record'

    Can any lounger help with instructions of one syllable to enable me to produce this form, please.
    Thanks
    Silverback
    Silverback

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

    Re: Setting up forms (Access 2K)

    To open the form on a blank record, use the On Load event of the form to move to a new record.

    You cannot use a bound control to search for records. You'll have to use an unbound combo box with a bit of VBA code.

    I have attached a database with a demo form. Look at the code behind the form to see how it is done. Note: if you want to use this in your own database, you must select Tools | References... in the Visual Basic Editor and tick the check box for the Microsoft DAO 3.6 Object Library.

    Don't hesitate to ask further questions.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting up forms (Access 2K)

    Hans
    Once again, I am indebted to you and your knowledge of Access; your solution worked perfectly.
    I do wish that these things didn
    Silverback

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

    Re: Setting up forms (Access 2K)

    I have no plans for writing a book about Access (or about anything else, for that matter).

Posting Permissions

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