By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

MS Access Calendar open form from Day Block

RockKandee
P: 89
I am using the MS Calendar found on this site with Access 2013 on Windows 8.

http://bytes.com/topic/access/answer...ccess-calendar

I am working on adding a form that opens from a day block on the calendar.

The date is in the sub form.

I tried using these

Expand|Select|Wrap|Line Numbers
  1.     DoCmd.OpenForm "Forms![MainScheduleCourses]![SubScheduleCourses]", , , "[SessionDate] = #" & _
  2.                       CDate(Me![txtDayBlock05].Tag) & "#"
Expand|Select|Wrap|Line Numbers
  1.     DoCmd.OpenForm "MainScheduleCourses", , , "Forms![MainScheduleCourses]![SubScheduleCourses].Form.[SessionDate] = #" & _
  2.                       CDate(Me![txtDayBlock05].Tag) & "#"
I tried a few other combos as well.

I couldn't get it to work.

Is this possible?

Kisses are waiting for you on this one ADezii.
Jan 2 '14 #1

✓ answered by ADezii

I took a radically different approach to your dilemma. rather than explain in detail what may/may not be what you are looking for, I'll simply Upload the Demo (RockKandee.accdb) and let you decide if this is what you are looking for.

Share this Question
Share on Google+
16 Replies


ADezii
Expert 5K+
P: 8,597
You are already Opening the MainScheduleCourses Form from the Dbl-Click() Event of frmCalendar. Assuming you have the proper Parent/Child Linkage between MainScheduleCourses and the SubScheduleCourses Sub-Form, there should be no further interaction on your part as regards the Sub-Form. Kindly explain what 'Opening the Sub-Form means'.
Jan 2 '14 #2

RockKandee
P: 89
When I use the code from the other thread using just the name of the main form and change [Start Date] to [SessionDate] then

I get a pop up box: enter parameter value - SessionDate.

When I click ok to the message box, then the form opens, but opens on a new record.

When I leave [Start Date] in the code I get the same error, which makes sense because start date isn't on the form. So it seemed likely to me that the code can not find SessionDate.

I was guessing this was due to [SessionDate] being in the sub form and that I needed to somehow refer to the subform + [SessionDate].

So I tried several ways including the code I posted above.

The parent/child link is proper as far as I can tell.

'Opening the Sub-Form means' - where did I post this at? I couldn't find it. Not sure what it means.

Thanks for your help.
Jan 2 '14 #3

NeoPa
Expert Mod 15k+
P: 31,186
RockKandee
"'Opening the Sub-Form means' - where did I post this at? I couldn't find it. Not sure what it means."

If you look at your first block of code you are using DoCmd.OpenForm and passing, as the FormName parameter, a reference to "Forms![MainScheduleCourses]![SubScheduleCourses]".

This is a string value which surely has a different meaning than you intended. If you'd used Forms![MainScheduleCourses]![SubScheduleCourses]!Name then you would have had a valid reference to the form class of that form you use as a subform. I'm afraid it would still be not what you wanted though. I suspect you want your subform to work as a subform rather than as a main form.

DoCmd.OpenForm() opens main, stand-alone, forms. Subforms are opened automatically when the related main form is opened. They are never added to the Forms collection and cannot be accessed that way (IE. Forms("SubFormName") will never work).
Jan 3 '14 #4

RockKandee
P: 89
I so wish I knew this weeks ago. I redesigned my entire database to work with this calendar and now my main form won't open with it. I am so sad :(

Oh well - back to the drawing board.

Thanks for the explanation, doesn't all sink totally in yet, but I retain pieces here and there.

Have a great night.
Jan 3 '14 #5

ADezii
Expert 5K+
P: 8,597
RockKandee, before you throw in the towell, are you able to Upload the Database with any sensitive Data removed? There are still some very confusing issues surrounding this Thread that may be able to be resolved by having the DB directly in front of us. At least we will all know exactly what you are referring to by direct observation. Just let us know.
Jan 3 '14 #6

NeoPa
Expert Mod 15k+
P: 31,186
I suspect my last post threw some light over certain matters, but equally suspect that you may have misconstrued a point in there to indicate something you want to do is not possible. That's not how I saw it. I'm thinking that what you want to do is simply done a different way from how you envisage it just now.

Having a fairly unclear idea of exactly what you're doing leaves me unable to help further at this stage, but like ADezii, I would advise holding on to that towel a while longer.

To be honest, an attachment with your work as it stands (data sanitised as suggested) combined with an offer from ADezii to assist, is a very strong position to be in. There are few, if any, who understand the concepts of such a database as well as he, and very few so prepared to go that extra mile to help those in need.
Jan 3 '14 #7

RockKandee
P: 89
A very generous offer from ADezzi indeed!!

I wasn't throwing in the towel - just heading back to the drawing board. I was very sad and had been working for 37 hours straight. After some sleep, I have a few ideas running around but need to think them through all the way.

I need some time to strip down the DB and get it posted - but will do so ASAP.

Again.....you all rock! but ADezzi gets extra kisses.

Thanks
Jan 3 '14 #8

RockKandee
P: 89
Update: I was in the middle of making some huge changes with my database when this offer was made. My changes crashed the whole project. So, I have been busy rebuilding. I now have it back up and running. I have stripped it down as much as possible while still leaving the form I am trying to open and the calendar working.

The form - MainCourseScheduling is the form I would like to have open to the matching day block of the calendar.

MainCourseScheduling has a continuous sub form.

In case the problem was due to the sub form being continuous, I tried to open the form after changing the sub form to a single form. I still get a pop up box: enter parameter value - SessionDate.

I have never zipped a file before. Let me know if I messed it up.

Thanks again for the help.
Attached Files
File Type: zip Scheduling - stripped.zip (1.82 MB, 67 views)
Jan 9 '14 #9

ADezii
Expert 5K+
P: 8,597
Was away for a few days with no access to a PC let alone Access. I have the DB now and I'll see what I can do.
Jan 12 '14 #10

ADezii
Expert 5K+
P: 8,597
You are attempting to Open a Parent Form (MainCourseScheduling) using a Date Criteria ([SessionDate]) that exists exclusively on a Sub-Form (SubCourseScheduling) contained within the Main Form. [SessionDate] cannot be used in the Criteria Argument of the OpenForm() Method since this Method applies to the Parent Form only and [SessionDate] does not exist in its Row Source. That is why you are getting the Error Prompt. What you can do is to create a Query (qrySessions) consisting of all Session Data as well as any related information. Create a Form named 'Session Data' and set its Row Source to this Query. In the Dbl-Click Event of each Day Block (TEXT Box) you can then Open the Session Data Form with Criteria set to the Date that the Block represents. Only those Session dates for the Date Block that you Dbl-Clicked will be displayed in Datasheet View. The Event for each Day Block would be:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtDayBlockXX_DblClick(Cancel As Integer)
  2.  DoCmd.OpenForm "Session Data", acFormDS, , "[SessionDate] = #" & _
  3.                   CDate(Me![txtDayBlock02].Tag) & "#"
  4. End Sub
As you can probably guess by now, I have revised your Attachment to display the concept that I have described and uploaded it as RockKandee_2.zip. Look it over carefully and tell me what you think.

P.S. - I am a certified Scuba Diver (PADI) so I can relate to what you are working on.
Attached Files
File Type: zip RockKandee_2.zip (3.23 MB, 87 views)
Jan 12 '14 #11

RockKandee
P: 89
Thank you so much for your time ADezii!! Sending kisses your way.

Not the news I wanted to hear, but understandable. I am always wanting the impossible. LOL

I will adjust my design accordingly, thanks for the example. I will post my results when I am done.

I am a PADI girl too and live in a PADI house,but I work for an ex PADI and now SSI gal. Keep on blowing bubbles ;)
Jan 12 '14 #12

ADezii
Expert 5K+
P: 8,597
Don't do anything drastic yet, I may be able to re-engineer this process for you. Give me a little time.
Jan 13 '14 #13

RockKandee
P: 89
I didn't mean to make it sound drastic.

I have an idea of how to do it so it will be easier for the user.
Not sure I can explain it clearly just yet, and I don't want to waste your time.

Give me some time to finish putting it together and I will post it. I am sure I will run into a glitch of some kind. Then I am gonna need you, and I would rather you not be sick of me by then ;)

You are a sweetheart - kisses.
Jan 13 '14 #14

ADezii
Expert 5K+
P: 8,597
I took a radically different approach to your dilemma. rather than explain in detail what may/may not be what you are looking for, I'll simply Upload the Demo (RockKandee.accdb) and let you decide if this is what you are looking for.
Attached Files
File Type: zip RockKandee_3.zip (1.84 MB, 89 views)
Jan 13 '14 #15

RockKandee
P: 89
ADezii - YOU ARE A GENIUS!!!!

I know - rules say no all caps - I broke em - My bad.

That so rocks.
This is me covering your face with smooches>> :* :* :* :* :* :*

I haven't had time to look at the code yet, but I didn't want to wait to send kisses. If there is anything I don't understand, I will let you know. I don't want to waste your time having to explain if it isn't needed.

Thanks a ton!!
Jan 14 '14 #16

ADezii
Expert 5K+
P: 8,597
I don't want to waste your time having to explain if it isn't needed.
You are not wasting my time - this is the reason all of us are here. Thanks for the Kisses and Smooches but I think that my wife is getting quite jealous! (LOL). Anything you don't understand, just let me know.
Jan 14 '14 #17

Post your reply

Sign in to post your reply or Sign up for a free account.