Solved

acCmdFormView for datasheet

Posted on 2003-11-21
11
914 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
[X]
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
  • 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

739 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