Results 1 to 6 of 6
  1. #1
    ballj_35 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Columbus Oh
    Posts
    25

    How to Make the Form Load display blank fields and not the first rec in DB

    When my form loads, it display the first record on the DB. Then I go into the Combo Box and get the data I want. How can I make the Form_Load and Form_Activate display a blank screen and then when I select a record from teh Combo Box, then the data gets displayed to the screen.


    Thanx in advance.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    This bit of code should do it, assuming that the Form is not Read-Only:
    Code:
    Private Sub Form_Load()
      DoCmd.GoToRecord , , acNewRec
    End Sub

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    ballj_35 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Columbus Oh
    Posts
    25
    Works great, Thank You very much! I have the following question now though. How come the following code does not work,

    cboBondSelect.Value = "<Please Select>"

    I have this code in the Form_Load and Form_Activate. Yet, when I load the form, the message does not display in my Combo Box. Thanx
    in advance.

    Jerry

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    No idea, sorry! Works fine for me!

    Do you get an error message?

    What is the RowSource Type for the Combobox?

    What is the RowSource for the Combobox?

    And, of course, double-check that cboBondSelect is the actual spelling of the Control.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    ballj_35 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Columbus Oh
    Posts
    25
    It works fine on one of the forms, but not on the other two. They all have unique combo box names. To address your question,
    The RowsSourceType is Table/Query and the RowSource is a Select statement to get the data from the table to select me member
    to edit/view.

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    I'm guessing that the Form it works on does not use a Select Query to populate its Combobox, which is why it works on that Form.

    But when you use a Select Query like this, to populate a Combobox, I believe the Value has to actually be part of the Query in order for your assignment of a Value (i.e. <Please Select>) to work.

    You can include it by using a Union Select Statement, using the general syntax

    Code:
    SELECT YourField FROM YourTable
    UNION SELECT "<Please Select>" FROM YourTable;
    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 11-07-2011, 06:31 AM
  2. Display Fields in Search Form
    By j2curtis64 in forum Forms
    Replies: 1
    Last Post: 07-18-2011, 01:37 PM
  3. make query fields not display if null data
    By rivereridanus in forum Queries
    Replies: 1
    Last Post: 07-05-2011, 08:19 AM
  4. Replies: 2
    Last Post: 02-03-2011, 12:41 PM
  5. Replies: 3
    Last Post: 02-01-2011, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums