Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

acCmdFormView for datasheet

Posted on 2003-11-21
11
910 Views
Last Modified: 2007-12-19
Good morning.

Here's my problem. I have a form "frmDataEntry" that has a subform on it called "fsubCalibration". The subforms default view is datasheet, but all views are set as available in the properties.

I want to creat a button on the main form with the onclick event or a double click event on the subforms field memProcedure that runs the DoCmd.RunCommand acCmdFormView action.

Specifically I want to make it easy for the user to change the subform from datasheet to form (note: I have the start up settings locking menus and right clicks down).

Ive tried the button by settinng the focus to the subform and running the cmd.
Ive also tried getting several events to fire on the field memProcedure in the subform unsucessfully.

Anyone have any suggestions. I am sure this is pretty simply.

thanks!!!

syntnx
0
Comment
Question by:syntnx
  • 6
  • 5
11 Comments
 
LVL 3

Author Comment

by:syntnx
ID: 9796596
OK nevermind, wrong cmd

Its :

DoCmd.RunCommand (acCmdSubformDatasheet)

not
acCmdFormView

syntnx
0
 
LVL 39

Accepted Solution

by:
stevbe earned 250 total points
ID: 9796656
Set the focus on the subform control first ...
Make sure that you are using the name of the subform control and not the name of the subform itself.

Me.SubformControlName.SetFocus
Application.RunCommand acCmdSubformDatasheetView


Steve
0
 
LVL 3

Author Comment

by:syntnx
ID: 9796672
thanks Steve, beat you to it

;)
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 39

Expert Comment

by:stevbe
ID: 9796762
did you set the focus to the subform first?
are you using the correct command?

Steve
0
 
LVL 3

Author Comment

by:syntnx
ID: 9796776
have to setfocus with the button but doubleclick works without because Im already on subform

syntnx
0
 
LVL 3

Author Comment

by:syntnx
ID: 9796823
Steve,

Im reqrding you the points and asking CS to cancel my request to delete the post. Think it may be helpful to others in the future

thanks again

syntnx
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9796906
did you end up using acCmdSubformDatasheet or acCmdSubformDatasheetView?
0
 
LVL 3

Author Comment

by:syntnx
ID: 9797091
datasheet actually
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9797683
After playing with this a bit I found that using acCmdSubformDatasheet is really a toggle between form and datasheet view types and acCmdSubformDatasheetView will only change it to datasheet.

Steve
0
 
LVL 3

Author Comment

by:syntnx
ID: 9797745
Ahhh, thought it was strange it would change back and forth. But hey that may be better. Otherwise I would have to create a separate event or button for changing it back

Learn something new everyday!

syntnx
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9797758
exactly what I was thinking, I am off from work today but on Monday I will be changing a couple of my standards :-)

Steve
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question