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

Update query help needed

Status
Not open for further replies.

air0jmb

Technical User
Sep 8, 2006
38
US
I have a table that captures details about events, tblEvents. A field 'txtDesc' has a description of the event. Within the description is an aircraft tail number. The tail is always 4 digits - the first is "N", and the 3 subsequent characters are numbers between 100 and 999.

I've created a field called Tail and would like to run an update query to update it to the tail number which resides in the field EventDesc.

Is that possible? If so, what would be the expression to use? And what if more than one tail number is in that field? For example, "...volume moved from N301 to N334" If that's a problem, I could except the first occurance.

Thanks in advance for any assistance!!

Mike
 
How is the tail number stored in your field EventDesc?

A wise man once said
"The only thing normal about database guys is their tables".
 
The tail is always 4 digits - the first is "N", and the 3 subsequent characters are numbers between 100 and 999.

Example 1: 0597/01 SDF-ABQ N301 (RT T/R inop).

Example 2: 8211/02 MHR-BOS N921 (hyd qty erratic); volume swapped to N807.

Mike
 
How about:
Code:
Dim strTest, astrTest, strTail
strTest = "8211/02 MHR-BOS N921 (hyd qty erratic); volume swapped to N807."
'strTest = "0597/01 SDF-ABQ N301 (RT T/R inop)."

astrTest = Split(Replace(strTest, ".", ""), " ")
For i = 0 To UBound(astrTest)
    If astrTest(i) Like "N###" Then
        strTail = astrTest(i)
    End If
Next
Debug.Print strTail
 
Remou,

Thanks for the response, but I was hoping for an expression that I could use in the 'Update To' field in an update query.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top