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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling textboxes with combobox data

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
I have a combobox list the names of vendors, phone numbers, fax numbers and e-mails. I got the data going to the textboxes by using:<br><br>Private Sub Vendor_AfterUpdate()<br>Me!Phone_Number = Me!Vendor.Column(2)<br>ect.<br><br>I'm getting an error with there is no phone number or fax number, ect.<br><br>What can be done to correct this?
 
personally. i prefer this method:<br><b><br>Me.RecordsetClone.FindFirst &quot;[Phone_Number] = '&quot; & Me![Vendor] & &quot;'&quot;<br>Me.Bookmark = Me.RecordsetClone.Bookmark<br>me.refresh<br></b><br><br>but that would link it to the first field in the combo box, you may want to try to add .Column(2) after [Vendor], or simply change the phone number in the vendor box (i'm assuming that is the second column) to the first. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Or test for numbers first using if/then/else. If not null(fax) and not null(number)then phone = vendor else &quot;no number&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top