Results 1 to 5 of 5
  1. #1
    Jester0001 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    69

    Dynamic Datasheet Caption


    I have a form with a datasheet. I can change the field names of the datasheet by changing the "Datasheet Caption" property on the property sheet. However, it seems that I can only have a static name for the field. Is there a way to have the Datasheet Caption be dynamic?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    In code it'd be

    Me.YourControlName.Controls(0).Caption = "Whatever"

    Just out of curiosity, why would you want to do something like this, dynamically?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Jester0001 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    69
    Using Access 2010, I was hoping to just try to set the Datasheet Caption in the Property Sheet window. I suppose I can resort to VBA if necessary.

    As for "Why?", the datasheet is on a form used for inserting lab results for consecutive days. One test has multiple results. Ex. The results for Day 2, Day 3, etc. The field names are "Day2", "Day3", etc. I already have validation in place to make sure that the results can only be entered in the records on the correct day, but if the field name has the correct date, then this will aid the user in data entry.

    Now I just need to figure out which control event I should use for the code.

    I'll try it out and let you know if it works.

    Thanks!

  4. #4
    Jester0001 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    69
    I got it to work per your suggestion. Thank you Missinglinq!

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Glad you got it working. You'll find that most anything you want to do dynamically has to be done through code or macros, with the most flexibility coming thru the use of code, not through the Property Pane.

    I understand about tracking lab results, having been in health care for 40 years, but your explanation of what you're doing is somewhat confusing, and hints at your app not being Normalized properly. The 'columns' of a Datasheet, which are actually Fields, should be made up of the tests being run and their Dates;

    TestDate CBC HGB Na+ K+, etc.

    with the TestDate usually being the first Field in the Record, not things like

    Day1, Day2, etc.

    At any rate, good luck with your project!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-04-2012, 03:41 PM
  2. Text to Caption conversion possible?
    By allstar45 in forum Forms
    Replies: 4
    Last Post: 02-15-2012, 07:18 AM
  3. Send object as PDF with caption name
    By Flytkjaer in forum Reports
    Replies: 6
    Last Post: 02-12-2012, 03:38 AM
  4. Dynamic Form, Dynamic labels/ captions?
    By JFo in forum Programming
    Replies: 15
    Last Post: 10-12-2011, 08:33 PM
  5. Dynamic Report Caption
    By Crypto in forum Reports
    Replies: 3
    Last Post: 11-17-2010, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums