Results 1 to 7 of 7

Thread: Date issue...

  1. #1
    Join Date
    Aug 2006
    Posts
    559

    Unanswered: Date issue...

    So after posting the other thread and trying to use pkstormy's calendar example, I can't figure out what's wrong to get it to work.

    I've retyped the form names and fields where, according to his code should go, but it keeps returning an error for debugging saying that it can't find the fields on the main form as well as any subforms.

    The code I have is like this:

    Code:
    DoCmd.OpenForm "CalPopUp"
    Forms!CalPopUp!frmIndividual = "frmIndividual"
    Forms!CalPopUp!subfrmIndStateID = "subfrmIndStateID"
    Forms!CalPopUp!Expiration = "Expiration"
    Does anyone know what's up?

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I'm not sure which calendar example you're using (I think I actually posted 2 or 3 different ones in the code bank.) Can you post your mdb? I'm not sure what you mean by you're getting an error on the main form. It could be because on 1 of the calendar examples, it uses the activecontrol (or previous control) code but if you can post what you have, I could quickly find the error and fix it for you.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Aug 2006
    Posts
    559
    Here it is...
    Attached Files Attached Files

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Hey you turkey, you changed a few things on how things actually worked with it. Anyway, here's how it should work in your mdb (all I did was import the CalPopUp form and then put in the same coding as that I had in the example - ie. see MainFormSub)

    See the subfrmIndStateID and the Dbl click event on the Expiration field as well as the calendar button next to it. Do the same type of coding for the other date fields. - try to understand the 3 fields it's populating when it opens the CalPopUp form: FormName (Name of the "main" form - ie...frmIndividual), SubFormName (leave blank if it's not calling from a subform otherwise enter the subform name - ie. subfrmIndStateID), and FieldName (name of the date field to populate on either the "main" form or "sub" form - ie. Expiration). From ANY date/time field, all you have to do is copy and paste the same code as what's in the cmdCalExpiration button (or dbl click event of the Expiration field) and then change the appropriate FormName, SubFormName, and FieldName that it should be calling from. Hope you understand this!

    (if you are going to make changes to the way I had the calendar form setup and the way you call it, you can't expect it to still work - I don't make any guarantees on changes.)
    Attached Files Attached Files
    Last edited by pkstormy; 09-03-08 at 19:28.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by pkstormy
    Hey you turkey, you changed a few things on how things actually worked with it. Anyway, here's how it should work in your mdb (all I did was import the CalPopUp form and then put in the same coding as that I had in the example - ie. see MainFormSub)

    See the subfrmIndStateID and the Dbl click event on the Expiration field as well as the calendar button next to it. Do the same type of coding for the other date fields. - try to understand the 3 fields it's populating when it opens the CalPopUp form: FormName (Name of the "main" form - ie...frmIndividual), SubFormName (leave blank if it's not calling from a subform otherwise enter the subform name - ie. subfrmIndStateID), and FieldName (name of the date field to populate on either the "main" form or "sub" form - ie. Expiration).

    (if you are going to make changes to the way I had the calendar form setup and the way you call it, you can't expect it to still work - I don't make any guarantees on changes.)
    Whatcha talkin' about willis? Changes? Me change nothing! Just kidding! I know, I changed a fair amount but tried to just add your calendar example in. The DB changed ENTIRELY from what I started with though.

    Thanks for the help!

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Hey you turkey, you changed a few things on how things actually worked with it. Anyway, here's how it should work in your mdb (all I did was import the CalPopUp form and then put in the same coding as that I had in the example - ie. see MainFormSub)

    See the subfrmIndStateID and the Dbl click event on the Expiration field as well as the calendar button next to it. Do the same type of coding for the other date fields. - try to understand the 3 fields it's populating when it opens the CalPopUp form: FormName (Name of the "main" form - ie...frmIndividual), SubFormName (leave blank if it's not calling from a subform otherwise enter the subform name - ie. subfrmIndStateID), and FieldName (name of the date field to populate on either the "main" form or "sub" form - ie. Expiration). From ANY date/time field, all you have to do is copy and paste the same code as what's in the cmdCalExpiration button (or dbl click event of the Expiration field) and then change the appropriate FormName, SubFormName, and FieldName that it should be calling from. Hope you understand this!

    (if you are going to make changes to the way I had the calendar form/routine setup and the way you call it, you can't expect it to still work - I don't make any guarantees on changes.) Are you sure you didn't get "my" calendar example mixed up with someone else's posted in the codebank? - your code in the CalPopUp looks nothing like my code at all.
    Attached Files Attached Files
    Last edited by pkstormy; 09-03-08 at 21:06.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I couldn't save the post changes because you were viewing it (or someone else or something happened.) Try seeing the attachment in my previous post now.
    Last edited by pkstormy; 09-03-08 at 21:02.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •