Results 1 to 5 of 5
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    VBA caption button of record

    Each record has a hidden text box of the date in year format (yyyy)

    I want a button on each record (I'm using a continuous form) to show the year

    I tried this
    Me.text.Caption = Format(Me.Text1, "yyyy")

    however that just puts on the one year and not each individual...?

    I can't figure out what is wrong. I want 2012, 2013 depending on the record text box.



    I'm basically trying to format the caption into year which works but I need it to show the individual record too..

    I'm making another form pop up when the date field is selected and they press the year they will be restricted to (yet to figure out).

    I know I could add a combobox to a table with the user selecting the year but I'd like them to simply have to make a choice between the available buttons. (I will hide years that are no longer in use).

    I'm yet to figure out how to restrict them putting in the date depending on what button they press on the pop of year select form but I figure it is achievable.

    Click image for larger version. 

Name:	Screen Shot 2013-08-19 at 6.15.55 PM.png 
Views:	21 
Size:	13.4 KB 
ID:	13482Click image for larger version. 

Name:	Screen Shot 2013-08-19 at 6.15.55 PM.png 
Views:	21 
Size:	13.4 KB 
ID:	13482
    Note: I have NO idea how the image capture just duplicated the image in the same one but just ignore that...

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    aaaaand it looks as though that won't work and I will have to make the textboxes into locked buttons ...

    http://bytes.com/topic/access/answer...us-forms-again

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    aaaaand it looks as though that won't work and I will have to make the textboxes into locked buttons ...

    http://bytes.com/topic/access/answer...us-forms-again

  4. #4
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    You can change the formatting of textbox to a hyperlink and transperent borders (to look a clickable ) and use the OnClick event

  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
    A Command Button is Unbound, and the Formatting of an Unbound Control on one Record is the Formatting of that Unbound Control on all Records! If the Formatting is conditional, depending on another Control on a Record, the Formatting of that Unbound Control on all Records will reflect the condition on the Current Record. Formatting the Textbox to look like a Command Button, and using its OnClick or DoubleClick event, is probably the way to go.

    Linq ;0)>

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

Similar Threads

  1. Replies: 22
    Last Post: 06-12-2012, 10:02 PM
  2. Replies: 4
    Last Post: 07-22-2011, 12:52 PM
  3. Replies: 10
    Last Post: 03-21-2011, 02:46 PM
  4. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  5. Replies: 6
    Last Post: 02-09-2010, 07:53 AM

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