Add to a bound listbox

A

Antonio

What I am trying to do is:

when a user enters an IP address in a text box and clicks
on Add, I want that IP address to be entered into a
listbox.

this is the code I have, but I don't want to use the
RowSource, since the IP addresses are assigned to
customers:

If Len(Me!List1.RowSource) > 0 Then
Me!List1.RowSource = Me!List1.RowSource & ";" & Me!Text1
Else: Me!List1.RowSource = Me!Text1
End If
 
J

John Vinson

this is the code I have, but I don't want to use the
RowSource, since the IP addresses are assigned to
customers:

ummm... and why would this be a problem?

You should be able to set the Rowsource to a query selecting distinct
IP addresses from the customer table. That way no code is needed, and
you won't risk exceeding the relatively limited number of values
allowed in a List of Values rowsource.
 
A

Antonio

It would be a problem because I have customers that exceed
400 IP ranges. Also, I have to be able to delete a range
when a customer changes IPs.

Thanks
 

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