I am new to VB. Could someone please tell me how to vary my select statement in one Sub based on a variable passed to that sub from another sub it was called from. For example:
In the calling sub, I found that I need a UID Number on Line_segment 65-295-100A. So I call the sub that searches for the UID called GETUID. In it I pass 2 variables. The Line_Segment name (65-295-100A) And a blank variable UID, both as strings. In the Sub called GETUID I want to select just the Line_segment 65-295-100A from my currentDB.OpenRecordSet.
My Select Statement looks like this.
Set rs = CurrentDb.OpenRecordset("select * from [STAR_LINE_SEGMENT1] where LINESEGNAME = ' & NewName & '"
The next time the I loop through my program I may want to look for a UID for a differant Line_segment.
Can you tell me what is wrong with my Set Statement?
In the calling sub, I found that I need a UID Number on Line_segment 65-295-100A. So I call the sub that searches for the UID called GETUID. In it I pass 2 variables. The Line_Segment name (65-295-100A) And a blank variable UID, both as strings. In the Sub called GETUID I want to select just the Line_segment 65-295-100A from my currentDB.OpenRecordSet.
My Select Statement looks like this.
Set rs = CurrentDb.OpenRecordset("select * from [STAR_LINE_SEGMENT1] where LINESEGNAME = ' & NewName & '"
The next time the I loop through my program I may want to look for a UID for a differant Line_segment.
Can you tell me what is wrong with my Set Statement?