Results 1 to 4 of 4
  1. #1
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Smile Populate text box with a button

    I have a form [form1] which contains two sub form [subform1] and [subform2]



    What I would like to do is:
    1. insert a button [btnAdd] on [subform2]
    2. When clicked it will add the text from [txt1] in [subform1]
    3. And populate [txt2] in [subform2]

    Basically the data in [subform1] is the last date, and instead of inserting the date for each transaction one click will do this. However occasionally the user will have to enter a different date so I don't want to link to a child field to populate the field.

    I hope this explanation is clear, is it possible to do this???

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    I can help with the code, but if you don't know how to insert buttons, then you need to get a book on basic Access usage.
    start a form, grab a button off the toolbar ,put onto form.
    grab a subForm, put on form.
    now design ANOTHER form. This is the sub form.
    assign this subForm name to the subForm object on the master form. assign the data source property to the subForm name.
    Place a button on the master Form, assign the ON CLICK event of the button.
    this populates the subForm date....

    me.sub.forms.txtDate = date

  3. #3
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    Thanks for the advise, I have added the button and sub form's etc I was just trying to be very clear on the end result:

    I added the following to the click event:
    Code:
     Me.frmSubStatementLastDate.Forms.MaxOfStatDate = MaxOfStatDate
    I got the error message Compile Error Method or data member not found at the .Forms

    Since original I have put subform1 =[frmSubStatementLast Date] which contains txtBox [MaxOfStatDate] onto the subform2 = [frmSubTransactionBalance] and I would like to place [MaxOfStatDate] into text box [trStatDate] on clicking the button

  4. #4
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    Just to clarify my last post:

    Since original I have put subform1 called [frmSubStatementLastDate] which contains txtBox called [MaxOfStatDate] onto the subform2 called [frmSubTransactionBalance] which contains text box called [trStatDate] and upon clicking I would like to place [MaxOfStatDate] into text box [trStatDate].

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

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2012, 09:37 AM
  2. Command button to populate subform
    By akhlaq768 in forum Forms
    Replies: 2
    Last Post: 02-07-2012, 04:57 AM
  3. Replies: 3
    Last Post: 10-17-2011, 01:13 PM
  4. Populate text boxes with a command button
    By Brian62 in forum Forms
    Replies: 3
    Last Post: 09-30-2011, 12:52 PM
  5. Replies: 0
    Last Post: 07-05-2011, 10:24 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