Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771

    I open the Reg Season Entries form, enter data into a (New) record row (some controls don't allow entry/edit). As soon as I hit the RdHmA combobox (the last control on the row) by Tab, Enter, or mouse click it populates with H or R.

    Don't know what else can offer as guidance.
    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.

  2. #17
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Hey June,

    I wanted to thank you for all of your help & time - as always! I started writing to you about surrendered in trying to figure out how to get this to work -- I'm just spending too much time spinning my wheels. Please, no reference to you. However, I gave it one last shot by downloading your dbs trying it again from scratch & I think that it's working as I wanted. Earily today when I tried, when I would enter a new Record & when I tapped on the 'RdHm' only 'R' was coming up with every new Record so I was all ready to throw in the towel. As I said, I gave it one more shot & I think it's working; 'H' is coming up in every other new recrd. I'll know for sure tomorrow morning when i enter teams results from this evenings games. Thanks

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    There is a slight flaw in my code. I wrote and tested it with data already in the table. If you start with an empty table the code will error because there is not yet a record saved in the table, therefore no Max("rsID") exists. This code handles that situation:
    Code:
    Private Sub Combo82_GotFocus()
        Dim strHR As String
        If IsNull(Me.Combo82) Then
            strHR = Nz(DLookup("RdHm", "[Reg Season]", "rsID=" & Nz(DMax("rsID", "[Reg Season]"), 0)), "")
            Me.Combo82 = IIf(strHR = "" Or strHR = "R", "H", "R")
        End If
    End Sub
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Setting default value for all records in form
    By robsworld78 in forum Forms
    Replies: 15
    Last Post: 08-14-2011, 12:48 AM
  2. Form Field Default Setting
    By roofbid in forum Programming
    Replies: 3
    Last Post: 12-17-2010, 10:53 AM
  3. Replies: 1
    Last Post: 11-01-2010, 06:59 PM
  4. Setting the Default Value and Proper Case Example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 07:43 PM
  5. Setting default values in columns
    By crownedzero in forum Programming
    Replies: 0
    Last Post: 06-17-2009, 06:45 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