BrDemos fmnuCustomers

L

Lisa

I was trying to replicate the fmnuCustomers and sfrmCustomers from
BrDemos but with the forms working on the LastName field instead of
CompanyName. Many of the customers in this db will be private
individuals with no company name.

I used the following code for the fmnuCustomers:

Option Compare Database
Option Explicit
Private Sub cmdIndex_Click()
Me.sfrmCustomers.SetFocus
Me![sfrmCustomers].Form![LastName].SetFocus
DoCmd.FindRecord Me.cmdIndex.Caption, acStart
End Sub

Private Sub cmdIndex_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
Dim strChr As String
strChr = Chr(CInt(Y / Me.cmdIndex.Height * 25 + 65))
If Me.cmdIndex.Caption <> strChr Then
Me.cmdIndex.Caption = strChr
End If
End Sub

Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If Me.cmdIndex.Caption <> "CUSTOMERS" Then
Me.cmdIndex.Caption = "CUSTOMERS"
End If
End Sub

Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
DoCmd.Close
Exit_cmdExit_Click:
Exit Sub

Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click
End Sub

I get an error message (object doesn't support this property or method)
for the line:
Me![sfrmCustomers].Form! [LastName].SetFocus

Can someone help me figure out where I went wrong? Thanks!
 
L

Lisa

I think I may have solved my own problem - sorry! I had not named the
field LastName.
 

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