Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Change View with VB

Author  Topic 

gwfran
Starting Member

9 Posts

Posted - 2004-08-10 : 19:53:39
Is there a way to convert the Access Form view to datasheet programmatically (VB)? Everything I've seen says no, but I've tried a couple of things (to no avail). I figure if anyone knows how to do this it'd be you guys.

Thanks in advance for any help you can lend.

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-10 : 20:00:14
Open the form. Right click in the form. Select 'Datasheet View'
Go to Top of Page

gwfran
Starting Member

9 Posts

Posted - 2004-08-11 : 11:26:01
I need to do it with code. The problem is that I have the default view set to Datasheet and, when I click on the form itself, it works beautifully. However, when I call the form from another form, it ignores the Datasheet setting and opens it as a Single Form. So then I looked into doing it programmatically and everything I've read says it can't be done (or the topic didn't exist). I find this very difficult to believe, though.

And even though I did have the brain fart about the Left vs Inner Join, I'm not a complete newbie.
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-11 : 19:17:37
Didn't mean to insinuate that you were.... ;)

I just used the following code to open a form (Form1) from another form and set the view to datasheet:
    DoCmd.OpenForm "Form1", acNormal
DoCmd.RunCommand acCmdDatasheetView
Go to Top of Page

gwfran
Starting Member

9 Posts

Posted - 2004-08-11 : 19:42:01
You, sir, are a gentleman and a scholar!

I had no idea that adding the second command line to the form would work execute like that. I guess I'm still used to subroutines executing in series - not parallel. But it worked like a charm!!

Thanks so much (again!)!!
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-11 : 19:55:41
The only thing that might interfere is if you had a lot of code in the Form_Load event procedure of the second form. I'm not certain, but I believe that the Form_Open code is executed before continuing with the calling procedure.
Go to Top of Page
   

- Advertisement -