Cllinking a Checkbox on a Subform to pull data from a textbox on a Mainform

MackMan

Registered User.
Local time
Today, 07:47
Joined
Nov 25, 2014
Messages
174
Clicking a Checkbox on a Subform to pull data from a textbox on a Mainform

I'm hoping someone can help.
I've been trying all sorts but I can't get this to work, despite searching for days on here.
I have a Mainform [FrmReconcileMain] and it contains a Subform [FrmReconcilesub]

What I'm trying to is, on the Main form type in a statement date in textbox [TxtStatementDate].

I have a checkbox on my subform [ReconciledYN], along with a textbox [TxtReconcileDateSub]. when I click the checkbox, it simply pulls the date from the mainform and populates the date in the subform.

I've even tried experimenting on a simple form (with no subform) to see whats going on, but still I can't get it to work, even on a simple event such as this...

If [yourcheckboxname] = -1 Then [controlnametoupdate] = date() Else [controlnametoupdate] = ""

any help would be much appreciated.
 
Last edited:
Post your database with some sample data, (zip it)!
 
Re: Clicking a Checkbox on a Subform to pull data from a textbox on a Mainform

I should be able to post a "zipped" example within the next day or two. Many thanks for your help :)
 
Okay, then I'll wait for that. :)
 
So here is my zipped file. What's I'm trying to do is ;
From the frmReconcileMain form, I enter details for when, say, a bank statement is delivered. I then go to the subform (frmreconcilesub) and the details of all transactions not yet reconciled appear here. What I want to do is click the "reconcileYN" checkbox on the subform, and it automatically populates the 4 details I want from the main form. I can get the code to work on a single form, I'm just not sure of the main form references within a subform in the VBA code.
 

Attachments

Hey Gasman thanks for that. I've tried every possible combination given on the reference you gave. It's still not working. Am I to assume that what I want to do is not possible? However one thing still confuses me a lot about referencing a form / subform, and that's the use and placement of the !'s and .'s
It changes a lot, and well. I just don't get it.
 
...What I want to do is click the "reconcileYN" checkbox on the subform, and it automatically populates the 4 details I want from the main form. I can get the code to work on a single form, I'm just not sure of the main form references within a subform in the VBA code.
So far I can see the code works okay, so ... what am I missing?
 
Hi JHB. I didn't think the code was incorrect, "but" it's not working. I have 2013. Is there something in settings I'm missing?
 
Hi JHB. I didn't think the code was incorrect, "but" it's not working. I have 2013. Is there something in settings I'm missing?
I don't have MS-Access version 2013, but in 2010 it works like you want it.
attachment.php
 

Attachments

  • Reconcil.jpg
    Reconcil.jpg
    48.6 KB · Views: 297
Hi JHB. I've just tried this on my laptop, and all is working fine, yet the same file will not work on my desktop!! Obviously I'm missing something in settings. I shall reinstall Access and try again! Many thanks for your time and help with this. It's much appreciated. Thank you!
 
Good it works somehow, are you sure the click event get fired in the version which doesn't work, (place a breakpoint in the code)?
Could it be some security setting?
 
I wonder if it's that stupid conversion error in 2013 - for some reason, a LOT of code written in versions of Access pre-2013 gets broken in A2013.

MackMan, what is the precise error message you're getting? Is it something about a missing library reference?
 
JHB, Froth; no error messages at all. All was exactly how I wanted it to be...
I just didn't have my database in the trusted location... Doh! All sorted now. Thanks guys for your help. Sorry to have wasted your time.
 

Users who are viewing this thread

Back
Top Bottom