Results 1 to 3 of 3
  1. #1
    vincydso is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Aug 2018
    Posts
    1

    Blank form when form is loaded in edit mode (combo box)

    Hello,

    I am developing a master/detail form to update QA data for Shop Orders in ERP system.
    Primary Key to the shop order header file is Shop Orders #
    Primary key to the Shop Order detail file is Shop order # and Line No.
    The form can only be open in Edit Mode and users are not allowed to add or delete records in the form.
    I have added a combo box on the form to "Find a record on my form based on the value I selected in my combo box" . combo box is created on shop order header table and is filtering based on Shop order No.
    When the form is open it loads the first record from the table. Subsequently when I select the Shop order # from the combo box it locates respective shop order # for the users to edit and this functionality is good to go.

    My Issues is when the form loads the first time, it should not default to the first record in the table but provide the user with a blank form and when the user selects the shop order # from combo box it loads the respective record for user to edit.
    How can this be achieved.? as mentioned users are not allowed to add new records in the form.

    Please advise.



    Vincent

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if the form is connected to the table, then you cannot have a blank form.
    either:
    have the form connected, on the 1st record, select item from combo then goto that record
    Code:
    sub cboBox_Afterupdate()
    If IsNull(cboBox) Then
      Me.FilterOn = False
    Else
      Me.Filter = "[id]=" & cboBox 
      Me.FilterOn = True
    End If
    end sub
    or
    have unconnected form, pick combo item, then load connected form of that record
    docmd.openform "fMyForm",,,"[id]=" & me.ID

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Set the form detail.visible property to NO
    Put the search combobox in the form header
    Then:

    Code:
    Private Sub cboBrand_AfterUpdate()
        Detail.Visible = True
        Me.Filter = "[Brand] = '" & cboBrand & "'"
        Me.FilterOn = True
    End Sub

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

Similar Threads

  1. Replies: 8
    Last Post: 06-26-2015, 06:00 PM
  2. Replies: 21
    Last Post: 08-05-2013, 06:23 AM
  3. Change form to edit mode using VBA
    By Richie27 in forum Programming
    Replies: 1
    Last Post: 06-05-2012, 04:39 AM
  4. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  5. Replies: 2
    Last Post: 09-01-2011, 10:48 PM

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