Chaim,
thanks for your answer...
that was exactly what I thought as well ....
problem is that, when these three extra letters are appended (or added in
between) lblAlpha the rest of the lebans label code doesn't even work for
the 'normal' letters anymore ....
now I decided to use two different labels and I am thinking around HOW on
earth I could use lebans generic formula for the three letter label
containing the extra leters
(Chr(64 - Int(-X / Me.lblAlpha.Width * 26)))
I love that generic formula and the label solution !!!
the lblShit now has only 3 letters in it instead of lblAlpha having 26
unfortunately I am not a maths wizard ....
as I understand the X is the position where the mouse clicks down onto the
label
as the user can click on e.g. the left part of the letter, the right part or
the middle part .... in any case the letter should be the result of the
whole lbl-code
so I had to give it a range from-to in order to get it to work
but how can I use that special formula together with the lblShit ???
maybe there's a maths fan out there, please ?!?!! who wants to help me
Thanks in advance,
Gina
******
Private Sub lblShit_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Select Case X
Case 10 To 210
Alphabet.SelectByLetter Chr(196)
Case 211 To 360
Alphabet.SelectByLetter Chr(214)
Case 361 To 560
Alphabet.SelectByLetter Chr(220)
End Select
End Sub
******
Public Function SelectByLetter(letter As String)
Dim rs As Object
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT Cust.custID, Cust.Name FROM Cust WHERE Cust.Name LIKE
'" & letter & "*'"
Set rs = Form__frmCust.Recordset.Clone
Set rst = CurrentDb.OpenRecordset(strSQL)
If rs.AbsolutePosition > -1 Then
rs.FindFirst "[custID] = " & rst("custID")
Form__frmCust.Bookmark = rs.Bookmark
' following code for subforms' unbound cboBoxes reflecting the
corresponding values for rs.Bookmark
Form__frmCust.cboSearch = Form__frmCust.custID
Form__frmCar.cboRegNum = Form__frmCar.RegNum
Form__frmWork.Refresh
Form__frmWork.cboWork = Form__frmWork.cboWork.ItemData(0)
End If
End Function
******
Chaim said:
Gina,
This could be written as a 'select case':
Me.Filter = "fldLastName LIKE " & Chr(34)
Select Case
Case 196:
& Chr(64 - Int(-X /
Me.lblAlpha.Width *