Combine 2 fields into one field

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
830
Office Version
  1. 365
Platform
  1. Windows
Is it possible to combine the information from 2 fields into a single field and store the result in a table?

I would like to be able to join the current date and the users name into a single field called "Last Accessed By".

Example:

Current Date field equals = 09/10/04
Users name field equals = Spectraflame
Last Accessed By field = 09/10/04 Spectraflame

Matthew
 
This will be used by multiply people if I get that far. Should another method be used?
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
The risk with this method is that when a user starts a new record the number is assigned but not saved until the record is completed. This means that if another user starts a record while the first is still open then the same number could be assigned twice. The easiest method to avoid this is probably to force a record save as soon as the number is assigned.

HTH

Peter
 
Upvote 0
Once the user chooses the department, the order number field is populated. Is there a way to force a save once the department selection has been made?

I guess I should also think about locking the department combo box once a choice has been made. I could see someone making a department selection, lets say Electric, then the work order would be saved and then realizing that they choose the wrong department and then choose another department leaving a blank record with a department of Electric.

Matthew
 
Upvote 0
After a great deal of trial and error I have come full circle on this issue.

I now have an opening form (WOSelectionfrm) that allows the user to select the department name from a combo box and a but that runs a select query to derive the next WOID.

The combo box properties are as follows:

Name - cboDept
Type - Table/Query
Row Source - SELECT [tblDept].[DeptName] FROM tblDept GROUP BY [tblDept].[DeptName];
Bound Column - 1

The create WO Button is programmed to run the following query on click:

SELECT [Forms]![WOSelectionfrm]![cboDept] AS WOType, [forms].[WOSelectionfrm].[cboDept] & Format$(Now(),"yy") & " - " & Right(cstr(val(right(nz(Max(b.WOID),""),5))+100001),5) AS WOID
FROM tblWorkOrder AS b;

The result is then splashed to the screen. The WOID is correct in that it returns the next number based on department, but it is giving me the full department name instead but I just need the first letter.

What I get - Electric04 - 00012
What I would like - E04 - 00012

If I can get just the first letter of the department to show up, would it be possible to have a query update the tblWorkOrder with both the WOType and the WOID?

Matthew
 
Upvote 0

Forum statistics

Threads
1,221,816
Messages
6,162,149
Members
451,746
Latest member
samwalrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top