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);
 
Back
Top