seperating information

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a field that contains two numbers seperated by a comma, for example
6,4. I need to put both numbers into their own seperate field. For example,
customer ID = 6 and vendor ID = 4. Does anyone know any code that would pull
the information before the comma and put it in the customerID field and also
pull the data from after the comma and put it in the vendorID field.

Thanks for the help!

at
 
I have a field that contains two numbers seperated by a comma, for example
6,4. I need to put both numbers into their own seperate field. For example,
customer ID = 6 and vendor ID = 4. Does anyone know any code that would pull
the information before the comma and put it in the customerID field and also
pull the data from after the comma and put it in the vendorID field.

Thanks for the help!

at

Add the CustomerID and VendorID fields to your table.
Run an update query.

Update YourTable Set YourTable.[CustomerID] =
Left([FieldName],InStr([FieldName],",")-1), YourTable.[VendorID] =
Mid([FieldName],InStr([FieldName],",")+1);
 
at said:
I have a field that contains two numbers seperated by a comma, for example
6,4. I need to put both numbers into their own seperate field. For
example,
customer ID = 6 and vendor ID = 4. Does anyone know any code that would
pull
the information before the comma and put it in the customerID field and
also
pull the data from after the comma and put it in the vendorID field.

Thanks for the help!

Dim a As Variant

a = Split(DelimitedField, ",")
Me!customerID = a(0)
Me!vendorID = a(1)
 
That worked, thanks!!

fredg said:
I have a field that contains two numbers seperated by a comma, for example
6,4. I need to put both numbers into their own seperate field. For example,
customer ID = 6 and vendor ID = 4. Does anyone know any code that would pull
the information before the comma and put it in the customerID field and also
pull the data from after the comma and put it in the vendorID field.

Thanks for the help!

at

Add the CustomerID and VendorID fields to your table.
Run an update query.

Update YourTable Set YourTable.[CustomerID] =
Left([FieldName],InStr([FieldName],",")-1), YourTable.[VendorID] =
Mid([FieldName],InStr([FieldName],",")+1);
 

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

Back
Top