Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2016
    Posts
    8

    Answered: Access - Button Issue

    Good morning people,

    So, I'm currently building a basic database for work and have came across a strange issue. (Please bare in mind, I'm still learning).

    I've created a button using the Wizard supplied by Access. It's the following selectable...

    Click image for larger version. 

Name:	Capture.PNG 
Views:	10 
Size:	13.6 KB 
ID:	16905

    So, as you can see I have highlighted the Find Record as that's the button I'm trying to create (it's created in Visual Basic so I literally don't even know why it's going wrong if I were to read it).

    When I open my form in a normal view, everything is fine and the button works perfectly. When I assign a button to open the same form in a Dialog view (which I prefer dramatically) it gives me this error message:
    Click image for larger version. 

Name:	Capture2.PNG 
Views:	7 
Size:	3.9 KB 
ID:	16906

    I can't figure it out, can someone please give me a hand!

    Thanks in advance!

  2. Best Answer
    Posted by Missinglinq

    "In the Form to be opened, go to (Properties - Other) and set Popup and Modal to Yes...this is what happens when you open a Form in Dialog Mode.

    Now go back to the button code for opening the Form and change acDialog to
    acWindowNormal.

    The Form should now open in 'Dialog Mode' (Popup = Yes/Modal = Yes) and the Find button should now function...did for me in testing!

    Linq ;0)>"


  3. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    Its possible the FIND button needs a recordset on the form to actually do the 'find'.
    Does your form have records bound to it?

    or
    the wizard is hosed and wont work here. (I seen this too)

  4. #3
    Join Date
    Jun 2016
    Posts
    8
    Quote Originally Posted by ranman256 View Post
    Its possible the FIND button needs a recordset on the form to actually do the 'find'.
    Does your form have records bound to it?

    or
    the wizard is hosed and wont work here. (I seen this too)
    First off many thanks for the reply, it's appreciated!

    What would you recommend for me to do? As I'd really prefer to be able to keep the form in dialog view instead of the normal view.

    As far as I'm aware, there isn't actually anything wrong with the code, it works perfectly fine up until I open the form in dialog view.

    I'm unsure what a recordset is, if you could advise me with details, I'd appreciate it!

    Thanks.

  5. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    In the Form to be opened, go to (Properties - Other) and set Popup and Modal to Yes...this is what happens when you open a Form in Dialog Mode.

    Now go back to the button code for opening the Form and change acDialog to
    acWindowNormal.

    The Form should now open in 'Dialog Mode' (Popup = Yes/Modal = Yes) and the Find button should now function...did for me in testing!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help! As you found out, when opening a Form from another Form, using code such as

    DoCmd.OpenForm

    things don't always work as they do when opening a Form directly from the Navigation Pane. The various parameters don't always work as expected, either!

    Under DataMode

    acFormAdd means that the user can add New Records but can't edit Existing Records.

    While acFormEdit means that the user can edit Existing Records and add New Records.

    Doesn't seem fair, does it?

    And while using in acWindowNormal in WindowMode is supposed to open the Form in the 'mode set by its properties'...in order to get a Form to open in Datasheet Mode...even if its Default View is set to Datasheet...you have to use acFormDS in the FormView parameter:

    DoCmd.OpenForm "YourFormName", acFormDS

    Good luck with your project!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •