Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Textbox updates then Checkbox will auto uncheck 1

Status
Not open for further replies.

iuianj07

Programmer
Sep 25, 2009
293
US
Hello guys..

I am trying to create this VBA for our database,, I have one textbox (for date Issue resolved) and a checkbox (issue)

So basically when we receive a loan, and we can't assign them out yet, we check the checkbox to say that there's an issue with the loan, and it won't show up to the analysts queue of loans to complete. However, when we have already resolved the issue, we put an issue resolved date (textbox) to have records when it was resolved, but we still need to uncheck the checkbox for it to show up to the analyst's queue. Manually unchecking it could cause it being overlooked at and won't show up to the anaylst's queue.

I tried creating this VBA but it gives errors:

Code:
Private Sub DateInitialReceiptIssueResolved_AfterUpdate()

Dim a As Date
Dim b As Boolean

a = DateInitialReceiptIssueResolved
b = InitialReceiptDocumentIssue


If a Is Not Null Then
b = False
End If


End Sub

Any help is appreciated.

thanks
 
You need the name of the checkbox, something like:


Code:
Private Sub DateInitialReceiptIssueResolved_AfterUpdate()

Me.InitialReceiptDocumentIssue = IsDate(Me.DateInitialReceiptIssueResolved)

End Sub

IsDate will evaluate to True if a date is entered.

 
Hello Remou,

thanks for the quick response,

I meant the other way around though,,, the InitialReceiptDocumentIssue is checked, and when we put a date in DateInitialReceiptIssueResolved textbox, the InitialReceiptDocumentIssue will be unchecked...

Can you please help me out re-writing this?

Thank you for your help....
 
Code:
Private Sub DateInitialReceiptIssueResolved_AfterUpdate()

'This will also switch back to true if the date is removed:
Me.InitialReceiptDocumentIssue = Not (IsDate(Me.DateInitialReceiptIssueResolved))

End Sub

Private Sub DateInitialReceiptIssueResolved_AfterUpdate()

'One way only - switch off and stay there, unless you want
'to add an Else, but you may as well use one line in that
'case
If IsDate(Me.DateInitialReceiptIssueResolved) Then
    Me.InitialReceiptDocumentIssue = False
End If
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top