[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 939
  • Last Modified:

acCmdFormView for datasheet

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
syntnx
Asked:
syntnx
  • 6
  • 5
1 Solution
 
syntnxAuthor Commented:
OK nevermind, wrong cmd

Its :

DoCmd.RunCommand (acCmdSubformDatasheet)

not
acCmdFormView

syntnx
0
 
stevbeCommented:
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
 
syntnxAuthor Commented:
thanks Steve, beat you to it

;)
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
stevbeCommented:
did you set the focus to the subform first?
are you using the correct command?

Steve
0
 
syntnxAuthor Commented:
have to setfocus with the button but doubleclick works without because Im already on subform

syntnx
0
 
syntnxAuthor Commented:
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
 
stevbeCommented:
did you end up using acCmdSubformDatasheet or acCmdSubformDatasheetView?
0
 
syntnxAuthor Commented:
datasheet actually
0
 
stevbeCommented:
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
 
syntnxAuthor Commented:
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
 
stevbeCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now