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!

Problem with Left String Function

Status
Not open for further replies.
Jun 26, 2001
41
US
Here is my code.

Private Sub cmdCompute_Click()
Dim critstr As String, x As Integer
For x = 1 To 8
If Me(&quot;combo&quot; & x) <> &quot;&quot; Then
critstr = critstr & Me(&quot;combo&quot; & x).Tag & &quot; = '&quot; & Me(&quot;combo&quot; & x) & &quot;' And &quot;
End If
Next x

critstr = Left(&quot;critstr&quot;, Len(&quot;critstr&quot;) - 5) ' I get an error on this line saying ' Ambiguous name detected: Left
' I don't understand why?

Me.picList.RowSource = &quot;SELECT Distinct lacIbase, Mutation, Count(Mutation) As [Number Observed] FROM The_Big_Query WHERE &quot; & critstr & &quot; group by lacibase, mutation&quot;
Me.Refresh

End Sub

 
you don't need critstr in &quot;'s if it is a variable
critstr = Left(&quot;critstr&quot;, Len(&quot;critstr&quot;) - 5)

should read
critstr = Left(critstr, Len(critstr) - 5)

Nick
 
Try using Right and Mid, if these give an error too, maybe the follwing might help (I copied this from the Acces General Discussion forum on a problem using the Right function).

The References window refers to object libraries available to you. An object file is a file with an .olb extension. There are five objects that need to be referenced (checked) for use with Access. These are Visual Basic for Applications, Microsoft Access 9.0 Object Library, Ole Automation, utility, and Microsoft DAO 3.6 Object Library. If any of these are unchecked, you need to check them. It might be necessary to have your Access 2000 installation CDs available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top