Re: cannot update field error box
- From: "OfficeDev18 via AccessMonster.com" <u14095@uwe>
- Date: Thu, 13 Jul 2006 13:23:29 GMT
You might try using the Nz() function, as in:
Me.Address1 = Nz(DLookup("[Address1]", "tblCustomersAddressBook", >"
[CustomerID] = Combo229")," ")
If the problem is null values, that should get rid of the problem.
Sam
StuJol wrote:
on a form i have a combo box (combo229) which once a value is selected it
updats fields on a form. the code in using in access2003 is below
Private Sub Combo229_AfterUpdate()
On Error GoTo Err_Combo229_AfterUpdate
' Add Customers Address Details To Work Order Form When Customer Name Is
Selected.
Me.Address1 = DLookup("[Address1]", "tblCustomersAddressBook",
"[CustomerID] = Combo229")
Me.Address2 = DLookup("[Address2]", "tblCustomersAddressBook",
"[CustomerID] = Combo229")
Me.City = DLookup("[City]", "tblCustomersAddressBook", "[CustomerID] =
Combo229")
Me.County = DLookup("[County]", "tblCustomersAddressBook", "[CustomerID]
= Combo229")
Me.PostCode = DLookup("[PostCode]", "tblCustomersAddressBook",
"[CustomerID] = Combo229")
Me.FirstName = DLookup("[FirstName]", "tblCustomersAddressBook",
"[CustomerID] = Combo229")
Me.LastName = DLookup("[LastName]", "tblCustomersAddressBook",
"[CustomerID] = Combo229")
Me.Company = DLookup("[Company]", "tblCustomersAddressBook",
"[CustomerID] = Combo229")
Me.Title = DLookup("[Title]", "tblCustomersAddressBook", "[CustomerID]
=Combo229")
Exit_Combo229_AfterUpdate:
Exit Sub
Err_Combo229_AfterUpdate:
MsgBox Err.Description & ", " & Err.Number,
CurrentDb.Properties("AppTitle")
Resume Exit_Combo229_AfterUpdate
End Sub
when i select a value from the combo, i get a msgbox saying "cannot update
field". the error doesnt appear to come from this code as i get no err number
in the msgbox. im certain the error occurs as a result of the dlookup
functions in the code being NULL.
is there any way of supressing this msgbox as it serves no function.
--
Sam
Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: cannot update field error box
- From: StuJol
- Re: cannot update field error box
- Prev by Date: Re: how do i access outlook to my program
- Next by Date: Re: quick simple question
- Previous by thread: Re: Link a text box to a combo box control
- Next by thread: Re: cannot update field error box
- Index(es):
Relevant Pages
|