My Assistant
![]() ![]() |
|
|
Apr 17 2012, 10:10 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
Hello,
I've created a form "Form1" with a subform "subform1" linked to it. I want to view them both in datasheet view. I am able to due this by simply changing the default view to "Datasheet" which I have done, but when I create a command button on a different form or the "Switchboard" and reference the "Form1" it appears as a single form with "subform1" appearing linked to it as a "Datasheet". Any suggestions would be great! Thank you and let me know if you need anything else to help in the solution.. |
|
|
|
Apr 17 2012, 10:32 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 4,606 From: From Hawaii - Now in Wisconsin...Am I Nuts? |
You can't have the main form as "Datasheet" view if you have a sub-form in it.
|
|
|
|
Apr 17 2012, 11:25 AM
Post
#3
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
It works fine if I open the form directly from the database window so i'm a little confused. All I'm trying to show is what a table would look like with a subdatasheet linked to it. Any other thoughts or am I just trying something impossible? Thank you accesshawaii!!
|
|
|
|
Apr 17 2012, 11:32 AM
Post
#4
|
|
|
Access Wiki and Forums Moderator Posts: 48,113 From: SoCal, USA |
Hi,
It works fine if I open the form directly from the database window so i'm a little confused. What exactly are you opening from the database window? Is it the table or the form? If it's the table, then yes you can see the datasheet and subdatasheet. If it's the form, then AccessHawaii is correct that you cannot do that. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Apr 17 2012, 12:06 PM
Post
#5
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
Thank you DBguy,
Its the form that i'm opening from the database window and it works perfect from the there. I'm just not understanding why it works if its not suposed to. the Form is set up to look just like a table with a subdatasheet. Any thoughts or should I just scratch the whole idea?? |
|
|
|
Apr 17 2012, 12:59 PM
Post
#6
|
|
|
Access Wiki and Forums Moderator Posts: 48,113 From: SoCal, USA |
Hi Shane,
If you can open the form from the Database Window in Datasheet View, then you will have to adjust your Switchboard code. Not sure if there's an option from the Switchboard Manager to select the mode of the form to open; but if not, then you can either tweak the code for the Switchboard, or add some code in the Open event of your form to open itself in Datasheet View. Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Apr 17 2012, 01:24 PM
Post
#7
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
Thank you DBguy,
I'm sorry to have to ask but would you happen to have any suggestions on how to tweak this code? |
|
|
|
Apr 17 2012, 01:42 PM
Post
#8
|
|
|
Access Wiki and Forums Moderator Posts: 48,113 From: SoCal, USA |
Hi,
I'm sorry to have to ask but would you happen to have any suggestions on how to tweak this code? I take it then that there is no option in the Switchboard to select what mode to open the form in? In that case, it might be easier to take a different approach than try to "tweak" the Switchboard code to avoid breaking it. What do you think of the following alternative: 1. Create a blank form 2. Make it really "small" 3. Update the Switchboard to open this small form instead 4. In the Current event of the small form, use the following code to open your actual form: DoCmd.OpenForm "FormName", acFormDS DoCmd.Close acForm, Me.Name Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Apr 18 2012, 07:04 AM
Post
#9
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
Thanks again DBguy,
It seems to be working except for the error message that i'm getting and the Debugging is highlighting: DoCmd.Close acForm, Me.Name I tried to change Me.Name to the name of the form which is "Form2" which didn't work. Any ideas?? |
|
|
|
Apr 18 2012, 08:53 AM
Post
#10
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
Thank you DBguy,
I figured it out, I placed this code in the OnCurrent: DoCmd.OpenForm "FormName", acFormDS And placed this code in the OnOpen: DoCmd.Close acForm, Me.Name This successfully opened the datasheet form and closed the small form at the same time. |
|
|
|
Apr 18 2012, 11:53 AM
Post
#11
|
|
|
Access Wiki and Forums Moderator Posts: 48,113 From: SoCal, USA |
Hi,
Congratulations! Glad to hear you got it to work. Good luck with your project. |
|
|
|
Apr 18 2012, 09:40 PM
Post
#12
|
|
|
UtterAccess Ruler Posts: 2,669 |
...I take it then that there is no option in the Switchboard to select what mode to open the form in? You only have two choices when you use the Switchboard Manager to create a Button to open a Form. You can open the Form in AddMode or EditMode, but no provision is made for opening it as acFormDS. This is just one of a number of reasons why most of us 'roll our own' switchboards, using a custom Form; the Switchboard Manager is simply too limited in what you can do and too rigid in how you do it! Linq ;0)> |
|
|
|
Apr 18 2012, 11:03 PM
Post
#13
|
|
|
Access Wiki and Forums Moderator Posts: 48,113 From: SoCal, USA |
Thanks Linq.
It's been a long while since I used the Switchboard Manager that I don't remember what's available anymore. Cheers (IMG:style_emoticons/default/cheers.gif) |
|
|
|
Apr 19 2012, 06:51 AM
Post
#14
|
|
|
UtterAccess VIP Posts: 4,606 From: From Hawaii - Now in Wisconsin...Am I Nuts? |
The Switchboard manager is very limiting for sure. Whenever I do development work on an existing database and it's a case where they had someone in-house create it who is not a developer. More often than not, it's done with switchboards and macros. I always try to talk them into allowing me to get rid of the Switchboard, which always has to be treated with kid gloves especially when the clien's have only had exposure to that person's database and think it's the greatest thing since sliced bread and can't imagine anything possibly being better and more user friendly.
|
|
|
|
Apr 19 2012, 08:40 AM
Post
#15
|
|
|
UtterAccess Ruler Posts: 2,669 |
...It's been a long while since I used the Switchboard Manager that I don't remember what's available anymore. I never did use it, except for answering questions like this! (IMG:style_emoticons/default/ohyeah.gif) ...when the clien's have only had exposure to that person's database and think it's the greatest thing since sliced bread... Well, there's sliced bread and sliced bread! Jewish Rye from the deli ain't the same as Wonder Bread! I mean Wonder has the red, yellow and blue balloons, printed on the wrapper, but it hasn't got caraway seeds! (IMG:style_emoticons/default/big_grin.gif) Of the many unhelpful things the Boys of Redmond have done over the years, I think the worst was telling people that with Access 'anyone can develop a database!' People whose only qualifications is an 'Access Introduction: 101' class probably account for 90% or more of all posts here! Some suit says "Oh, you took a class in Access? How about running up a database to track all of our salesmen and their orders, and while you're at it, let's keep track of our raw materials, too! And employees benefits...that's be good, too! You can do it next Friday in between making out payroll and running the end-of-month reports!" So first the poor shmuck goes (IMG:style_emoticons/default/iconfused.gif) and then (IMG:style_emoticons/default/pullhair.gif) and finally (IMG:style_emoticons/default/compute.gif) "Dear UtterAccess..." Linq ;0)> |
|
|
|
Apr 19 2012, 09:49 AM
Post
#16
|
|
|
UtterAccess VIP Posts: 4,606 From: From Hawaii - Now in Wisconsin...Am I Nuts? |
That's absolutely true. Years ago after I got out of the military, I had a DOD job and I wanted to learn Access (Had absolutely nothing to do with the job I was doing but being the government, they'll pretty much pay for any type of training you want). One thing that will always stick out in my mind from that class is I had asked the instructor if it's possible to export data from Access to Excel and he told me theres no way that he knows of to do that. This was an instructor mind you, who was teaching other's his expertise. Shortly after that I came to find out that exporting to Excel is actually a pretty common thing. As far as the most important parts of development e.g. table design and database theory, did not touch on that one bit. Just taught you how to basically make tables, forms, reports, and queries.
Looking back at that, I wonder if that's the type of training that others are getting when their companies send them to Access training and then expect them to design a database? |
|
|
|
Apr 19 2012, 03:22 PM
Post
#17
|
|
|
UtterAccess Ruler Posts: 2,669 |
I went back to school late in life to work on a degree in programming and got stuck in an introductory Access class because of scheduling problems. Our instructor's idea of teaching was reading from the textbook, line for line! Except every once in a while he got lost and a student would have to show him where he left off! It just so happened that my faculty adviser was also the chair of the IT department and a friend. I demanded my tuition back and when she asked why, I told her that I could read the textbook for myself, thank you very much, and explained what was going on! She was most embarrassed, stating that he was actually an adjunct instructor from the criminal justice department, needed another class to teach, and stated that he was proficient in Access. She also refunded my money and replaced the instructor herself, until she could get someone else who was qualified!
Linq ;0)> |
|
|
|
May 17 2012, 01:44 PM
Post
#18
|
|
|
UtterAccess Addict Posts: 273 From: Columbus, Ohio |
WOW!
(IMG:style_emoticons/default/ohyeah.gif) (IMG:style_emoticons/default/ohyeah.gif) (IMG:style_emoticons/default/ohyeah.gif) (IMG:style_emoticons/default/ohyeah.gif) (IMG:style_emoticons/default/ohyeah.gif) Thank you for the HELP!! |
|
|
|
May 17 2012, 05:16 PM
Post
#19
|
|
|
Access Wiki and Forums Moderator Posts: 48,113 From: SoCal, USA |
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 07:44 PM |