Asterisks in fields...

  • Thread starter David Ehlert (dehlert)
  • Start date
D

David Ehlert (dehlert)

I have a simple table that looks like this...

DN 21084
TYPE 500
TN 037 0 05 09 MARP DES 341057 4 SEP 2002
DN 21086
TYPE SL1
TN 047 0 03 01 KEY 01 H MARP DES 013562 6 DEC 2004
(2008)
TN 047 0 08 04 KEY 01 DES 013562 6 DEC 2004
(2008)
TN 047 0 06 07 KEY 01 H DES 013562 6 DEC 2004
(2008)
TN 047 0 04 02 KEY 01 H DES 013562 1 DEC 2004
(2008)
TN 047 0 04 00 KEY 01 H DES 013562 1 DEC 2004
(2008)
DN 9
TYPE NARS
NTBL AC1
DN *22
TYPE FFC
FEAT MSBA
DN *23
TYPE FFC
FEAT MSBD
DN #1
TYPE FFC
FEAT CFWA CFWD
DN #2
TYPE FFC
FEAT SPCC

As I go through the file, if I see a 'DN' line with an asterisk or pound
sign, I need to move forward in the file two lines. How do I test for the
asterisk as shown below..??

If Mid(RS1!txtdata, 6, 1) = "*" Or Mid(RS1!txtdata, 6, 1) = "#" Then
RS1.Move (2)
End If

I have even tried the following with no luck either...

If Mid(RS1!txtdata, 6, 1) = Chr(42) Or Mid(RS1!txtdata, 6, 1) = "#" Then
RS1.Move (2)
End If

So, how do I search for the asterisk with a MID function..??

Any help or direction would be appreciated.

David Ehlert
IT Analyst
County of Fresno
 
D

Douglas J. Steele

Mid(RS1!txtdata, 6, 1) = "*" returns True for me, so I suspect there's
something else going on here.

Are you certain it's not recognizing the asterisk? What happens if you use

If Mid(RS1!txtdata, 6, 1) = "*" Or Mid(RS1!txtdata, 6, 1) = "#" Then
MsgBox "Aha! I found either * or #!"
RS1.Move 2
End If

Does the message box appear?

If it does, try removing the parentheses from around the 2
 
D

David Ehlert (dehlert)

Thanks for the direction. The msgbox did appear and that helped me find my
problem. I just didn't think it was finding it.

David
 

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