Microsoft
Software
Hardware
Network
Question : After Update in Access
I am reposting this question as can't seem to solve and I may have originally not posted in enough areas:
I have a form where a user enters a client ID number [txtDBNO] as well as an item [comboitem]; the form is bound to table [tblCharges]. The code I''m using is supposed to look up the [txtDBNO] in the table [tblClient] and determine whether this client is supposed to be assesed [HasHandlingCharge] and if so it then is supposed to return the logical value [HasHandlingCharge] to the [chkHandlingCharge] and enter that into [tblCharges].
The users enter the [txtDBNO] first and then enters the [comboItem] and the code I'm using returns the correct value into [chkHandlingCharge]. And if the user changes his/her mind and changes the [comboItem] the code will replace the current contents of [chkHandlingCharge] correctly.
However, if the user is happy with what is in [comboItem] but realizes they have the wrong [txtDBNO] and changes it, the [chkHandling] does not change accordingly. Puzzled and confused what I'm doing wrong. I have two AfterUpdate routines... What am I doing wrong? How can I fix? Thanks! (AfterUpdate does mean after a change has been made to a control and you move to a different control, correct? Sorry for pedantic questions, I'm very much new to this). Thanks.
Private Sub comboItem_AfterUpdate()
If Nz(DLookup("HasHandlingCha
rge", "tblClient", "DBNO = '" & txtDBNO & "'"), False) = True Then
chkHandlingCharge = DLookup("HandlingCharge", "tblItems", "Item = '" & comboItem & "'")
Else
chkHandlingCharge = False
End If
End Sub
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
--------
Private Sub txtDBNO_AfterUpdate()
If Nz(DLookup("HasHandlingCha
rge", "tblClient", "DBNO = '" & txtDBNO & "'"), False) = True Then
chkHandlingCharge = DLookup("HandlingCharge", "tblItems", "Item = '" & comboItem & "'")
Else
chkHandlingCharge = False
End If
End Sub
Answer : After Update in Access
Is chkHandlingCharge a CheckBox Control on your Form??? You can only set a CheckBox to True or False.
Can you load up a sample of your db???
ET
Random Solutions
Java Script - Toggle a checkbox by clicking on an image
OpenRecordSet querydef with parameter problem Access 97
User Search and Disabling Application by Active Directory
I changed the motherboard and cpu on a panasonic cf-50 laptop. my hard drive is blue screening because of the new hardware How can I fix this without having to reformat the drive?
File Upload & Download using ASP.net 2.5 & MVC2.0
TextBox and Validation Rule
Where are my e-mail messages?
I have a Windows Server 2003 OEM key, but only a Windows 2003 Server Enterprise Edition Disk. How can I use the Enterprise edition disk to install regular Server (non-enterprise)?
Interrupt windowsw startup for installtion tasks
Digging in to somebody else's stuff