Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    BackColor is restored when one of the textboxes on Main receives focus or cursor passes over and off button.

    I even built a new form in your db with a button and a textbox. Get this same behavior. Sorry, cannot find cause. However, I tried this code and it causes button to restore BackColor.

    Private Sub Command0_Click()
    DoCmd.OpenForm "BulkServiceEntry", , , , , acDialog


    Me.Text1.SetFocus
    End Sub

    Advise to not use space in object naming.
    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
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I copied your form then added a button to it (command55) and got that flat style you're using. I played with styles to see if I could replicate what you have & ended up with what's there, but not normal to me. There seems to be no way to change its style to what I normally see by using the property sheet or ribbon. So I opened a new form in design and added a button and got the style I'm used to and pasted that onto the copied form. It retained its style. So why does that form enforce the flat style yet a new form does not? If you didn't create that style from the ribbon then where does it come from? Puzzling. Regardless, command0 exhibits the same behaviour as your original buttons.

    Click image for larger version. 

Name:	1Butns.jpg 
Views:	17 
Size:	11.9 KB 
ID:	49823
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #18
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi June
    Thanks for the reply. I thought that I'd have to code something. Seems silly though.

  4. #19
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi Micron. Thanks for your efforts. I generally create a button by using the wizard on the ribbon but cancelling before the wizard completes. Then resize to what I want and it ends up looking like the flat style. Colours etc I add manually and don't use themes. I'll keep plugging away at it and see if I can get a resolution on Monday.

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    It is silly but only way I could get desired result. I avoid the build wizards but doesn't seem to be cause of issue here as I did not use wizard in my test.

    Does this behavior occur in a new database?
    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.

  6. #21
    sheusz is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2015
    Posts
    151
    Hi June7

    So I've been tinkering some more with this and have made some curious observations.

    Following your suggestion I opened the new form by altering the properties of the command button.

    DoCmd.OpenForm "CustomerRecords", , , , , acDialog
    and this seems to resolve the issue, and I didn't need to SetFocus to a text box on the main screen.

    Now, if I open a form using
    DoCmd.OpenForm "BuklkServiceEntry", , , , , acWindowNormal
    the issue remains even if I SetFocus to a text box on the main screen

    Not sure what to make of these findings. Personally I don't like the look of the Dialog forms, plus I don't fancy editing the entire DB so all of the forms are Dialog forms for standardisation.
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 21
    Last Post: 02-08-2019, 11:18 AM
  2. Resetting Autonumber Field on command
    By Paul H in forum Programming
    Replies: 2
    Last Post: 04-17-2014, 12:43 PM
  3. Replies: 6
    Last Post: 11-14-2013, 07:37 AM
  4. Replies: 3
    Last Post: 08-04-2013, 07:11 AM
  5. Replies: 1
    Last Post: 07-27-2010, 02:27 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