Some of the code may help - access

无戒非无戒律。“无“便是“有“,“有”便是“无”。有有则“无”,无无则“有“。实乃敬仰持戒之慎独,严于律己者而自醒也。
打印 被阅读次数

If you have a form Name "invAHLList". Click a "InvoiceIDList" on the form, you can update the value of a field in the table "invHead" and using where to sort a record line has the same invoiceID with the one you select in the "invoiceIDList".Here is the code:

CurrentDb.Execute "Update invHead SET InvAcctRcvbCheck = -1" _& " WHERE [invoiceID] =" & Forms![invAHTList]![invoiceIDList]

NZ(Expression, valueWhenIs Null) is very useful. The following code returns the value and 'Null" when it is null:

Dim rate As String
rate = Nz(DLookup("invExRate", "invAHTqry", "[invoiceID]=" & Me.invoiceIDList), "Null")
MsgBox ("rate=     " & rate)

登录后才可评论.