Results 1 to 7 of 7
  1. #1
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245

    Items automatically selected in combo box on data entry form

    Hello,

    This is my set up:

    I have a Master Form, Which I will select the client, and the Product. then i can veiw a bunch of different data from the tables.. now on this form i have add Account details....

    This opens a data entry form for account details...

    In the ClientID, and ProductID for this table I have combo boxes set up... (I can see a text name instead of number).

    I currently have these combo boxes search on what i have selected in the MasterForm...It only shows me that option... What i want it to do, is automatically select them.. that way i dont have to select them each time. As well as how can i set it up that it doesnt automatically update the form for a new entry unless i click a button i have set up as Save and Close.



    Thanks,

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Don't understand. You want data entry form to open filtered by criteria entered on Master Form? Why not use form/subform arrangement?

    Records entered on a bound form with bound controls are committed to table when moving to another record, close form, or run code. Once data is entered into a new record row, the only way to not commit the record is to undo the entries.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    I have this master form set up to veiw data, and edit etc. But when i need to Execute a new entry. I click a button which opens a form..

    currently the combo boxes filter from the Master form, but how can i get that to be the value it selects without input it as a new entry until i click the button.. The reason is i still want to be able to veiw my data in tables as i enter new data, and this allows my to do so.. It is much easier to input in form over the table...

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    You have master form in continous or datasheet view so all records are viewable? You might find this of interest http://www.fmsinc.com/MicrosoftAcces...edSubforms.asp

    Otherwise, use code to load data from the master form. Perhaps in the data entry form Open event.

    If Me.NewRecord Then
    Me.fieldname = Forms!mainform.fieldname
    End If

    Allowing option to cancel the entry is trickier. Maybe: Docmd.RunCommand acCmdUndo

    Might want to disable the X close button.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    Is there a way set up a close button... Closes the form, and promts the user to save or not to save?

    Im thinking some sort of IF

    IE.

    If Me.FormName = Dirty Then
    Promt Save

    Else

    Docmd.RunCommand acCmdUndo
    Docmd.Close "FormName"

    EndIF

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    That might work. I have tried Undo but couldn't get it to work right and resorted to Sendkeys "{ESC} {ESC}" - but it has been a while, maybe I should visit code again.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    mike02 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    245
    I used this and got it to work! thanks for your help!


    Code:
    If Me.Dirty Then
       If MsgBox("Do you want to save?", VbYesNo + VbQuestion, _
           "Save Record") = VbNo then 
         Me.Undo
       End IF
    End IF

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

Similar Threads

  1. Replies: 1
    Last Post: 12-06-2012, 06:11 PM
  2. Replies: 3
    Last Post: 09-19-2012, 11:40 AM
  3. Combo Box Data Entry Form Issue
    By MintChipMadness in forum Forms
    Replies: 24
    Last Post: 08-06-2012, 05:04 PM
  4. Replies: 18
    Last Post: 01-27-2012, 12:53 PM
  5. Data Entry Form: Retain Selected List Box Value
    By William McKinley in forum Forms
    Replies: 1
    Last Post: 11-05-2010, 10:14 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