1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access-Command button to open form in datasheet view

Discussion in 'Business Applications' started by Diane Herron, Nov 19, 2002.

Thread Status:
Not open for further replies.
Advertisement
  1. Diane Herron

    Diane Herron Thread Starter

    Joined:
    Dec 28, 2000
    Messages:
    81
    I think I'm losing my mind. Have created a command button to open a form. The form I want to open is set to Datasheet view. Everytime I click the button, the form opens in Single Form view. I can also set it to Continuous Form view which will work. But, it doesn't matter if I set it to Datasheet or Single, it will only open in Single view when I click the button.

    By the way, when I simply open the form (without clicking the button to open it), it works fine.

    Thanks for any help!
     
  2. downwitchyobadself

    downwitchyobadself

    Joined:
    Oct 13, 2000
    Messages:
    941
    Look at the code under [Event Procedure] on the command button in question, by clicking on the ... button to the right of the line in the control properties window. I'll bet it says something like this:

    DoCmd.OpenForm "MyFormName", acNormal

    Or nothing at all after "MyFormName", since acNormal is the default. Make it say

    DoCmd.OpenForm "MyFormName", acFormDS

    instead.

    Hope that helps.
     
  3. Diane Herron

    Diane Herron Thread Starter

    Joined:
    Dec 28, 2000
    Messages:
    81
    Thanks for the response. However, I am not familiar with Event Procedures (not a real experienced Access user). This command button was created with a macro where I simply selected the OpenForm action. The form I want to open is set to Datasheet for the Default View. It opens in Datasheet view when I just open it by itself (without using the button).

    Any other help you can offer?

    Thanks!
    Diane
     
  4. Diane Herron

    Diane Herron Thread Starter

    Joined:
    Dec 28, 2000
    Messages:
    81
    Hey, I just copied your suggestion for the Event Procedure and it worked. However, one problem always seems to lead to another. The problem now is just weird. I will attempt to explain it.

    When I click the button, the form opens in Datasheet view on top of the other form. I close the form that was opened by clicking the button and I just have solid gray appearing where the form was. The computer seems to be locked up and my only alternative is to close Access. I've opened Access and tried this several times and it happens every time.

    Thanks,
    Diane
     
  5. downwitchyobadself

    downwitchyobadself

    Joined:
    Oct 13, 2000
    Messages:
    941
    I don't really understand either of your posts, I'm afraid. Could you post the macro procedure with arguments and the event procedure here?
     
  6. Diane Herron

    Diane Herron Thread Starter

    Joined:
    Dec 28, 2000
    Messages:
    81
    You can disregard the first post. The second post that states "I copied the Event Procedure and it works", is the one I'm having trouble with. The procedure does work in that it opens the form in Datasheet view. However, I am then unable to do anything else other than close Access. I have attached a picture to illustrate what I'm talking about.

    Thanks for all your help.
     

    Attached Files:

  7. downwitchyobadself

    downwitchyobadself

    Joined:
    Oct 13, 2000
    Messages:
    941
    That's why I asked you to post the code; I understood what was happening, I just wanted to see the event procedure itself.

    It's an improperly terminated echo statement. You are somewhere in your code saying "echo false" or "application.echo false", and at the end of your procedure you need an "echo true" statement to match it.

    Echo turns on/off screen updating.
     
  8. Diane Herron

    Diane Herron Thread Starter

    Joined:
    Dec 28, 2000
    Messages:
    81
    Thank you soooo much. I entered the "Echo true" and worked perfectly!
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/104734