+ Reply to Thread
Results 1 to 6 of 6

How do I display module results in a form text box

  1. #1
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    How do I display module results in a form text box

    Hello all,
    I have played around with many variations and this what I have come up with so far. The below code as you can see is a function and I have it in a module called JulianDateConvert since I have not been able to combine it with the Sub (probably cant combine them).

    Please Login or Register  to view this content.
    The below code should call the function 'CDate2Julian' above, retrieve the user entered date from the text box called ReqDate and place the converted date into the JulianDate text box.


    Please Login or Register  to view this content.
    Testing

    Please Login or Register  to view this content.
    in immediate mode returns the correct date for 8-11-2009 which is 9223.

    Using

    Please Login or Register  to view this content.
    in immediate mode for the same date above displays 2223 in immediate mode in which the first digit should be a 9.

    Can someone please assist me in getting the correct julian date to display on the form either after the date is entered on the form or when a button is pressed.

    Thanks,
    Andrew
    Last edited by drewship; 08-17-2009 at 10:46 AM.

  2. #2
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: How do I display module results in a form text box

    I have a couple of questions.

    First off is this form open?

    Do you want this date stored in a table, or is it a one time date?

    My answers change based on these questions.

    However I do have some answers.
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  3. #3
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: How do I display module results in a form text box

    I am gonna save you some time and try and answer it anyway.

    Enter the following in the "Control Source" field in the properties of your field in your form called : JulianDate

    Please Login or Register  to view this content.
    I tested this off a date field that I have in my database.

    You shouldn't need any vba for this, if this is what you were thinking.

    Hope this helps,

    Dan

  4. #4
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: How do I display module results in a form text box

    Thanks for the code Dan. I will answer your questions then try the code.

    First off is this form open? Yes. The user has the form open selecting items. Once the user enters the date, I want the julian date to be calculated.

    Do you want this date stored in a table, or is it a one time date? I need this stored in a table as part of the key to identify individual orders.

    Andrew
    Last edited by drewship; 08-14-2009 at 08:39 AM.

  5. #5
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Re: How do I display module results in a form text box

    The code works to display the julian on the form and I have added a text box that will be hidden and will save the value to the table via the control source. There may be a better way but I am still learning.

    Thanks,
    Andrew

  6. #6
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: How do I display module results in a form text box

    Glad I could help, please mark your post as solved if you are satisfied with the answer.

    Thanks,

    Dan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1