Event Procedure Update txtbox

Z

Zanstemic

The following is an event procedure that runs After Update of a pull down
menu. Everyone works fine except for number 7 which returns a null value. If
I switch the phone and fax, in the sql code or in the procedure, it works
fine.

Any suggestions?

Event Procudure
Private Sub cboAttorneyID_AfterUpdate()
attorneystreetaddress = cboAttorneyID.Column(2)
attorneycitystatezip = cboAttorneyID.Column(3) & ", " &
cboAttorneyID.Column(4) & " " & cboAttorneyID.Column(5)
attorneyphone = cboAttorneyID.Column(6)
attorneyfax = cboAttorneyID.Column(7)
End Sub

Query
SELECT Attorney.AttorneyID, [Attorney.LastName] & ", " & [Attorney.First
Name] AS Expr1, Attorney.Address, Attorney.City, Attorney.State,
Attorney.Zip, Attorney.Fax, Attorney.Phones
FROM Attorney
ORDER BY [Attorney.LastName] & ", " & [Attorney.First Name];
 
J

John Spencer

I assume you know that the columns are zero-based. So the seventh column is
referred to as Column(6)

Beyond that I can't see what would cause the error.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Z

Zanstemic

Yes, I did find that it starts with Column(0) so the one not working is 8+

I'm wondering if a limit exists when using Column?

Any suggestions are appreciated

John Spencer said:
I assume you know that the columns are zero-based. So the seventh column is
referred to as Column(6)

Beyond that I can't see what would cause the error.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
The following is an event procedure that runs After Update of a pull down
menu. Everyone works fine except for number 7 which returns a null value. If
I switch the phone and fax, in the sql code or in the procedure, it works
fine.

Any suggestions?

Event Procudure
Private Sub cboAttorneyID_AfterUpdate()
attorneystreetaddress = cboAttorneyID.Column(2)
attorneycitystatezip = cboAttorneyID.Column(3) & ", " &
cboAttorneyID.Column(4) & " " & cboAttorneyID.Column(5)
attorneyphone = cboAttorneyID.Column(6)
attorneyfax = cboAttorneyID.Column(7)
End Sub

Query
SELECT Attorney.AttorneyID, [Attorney.LastName] & ", " & [Attorney.First
Name] AS Expr1, Attorney.Address, Attorney.City, Attorney.State,
Attorney.Zip, Attorney.Fax, Attorney.Phones
FROM Attorney
ORDER BY [Attorney.LastName] & ", " & [Attorney.First Name];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top