Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

Find by Lastname does not work, until we click by Firstname, then

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Situmorang - 13 Mar 2008 05:46 GMT
Hello,

I have a problem in my Find Form that when I chose by Last name, it won't
work, I have to go to option 2 by Fist name, then to by Last name then it
works.

Can anyone help me how to solve this problem?

This is my VBA:
Private Sub optChoose_AfterUpdate()
   ' Populate rowsource of cboSelect
   
   Dim strSQL As String
   
On Error GoTo HandleErr

   Select Case optChoose
       Case 1
           ' NamaAkhir/Marga
           strSQL = "Select Distinct LName from BukuAngKbyQuery " _
             & "Order By LName"
      Case 2
           ' Nama Awal
           strSQL = "Select Distinct FName from BukuAngKbyQuery " _
             & "Where FName Is Not Null Order By FName"
       Case 3
           ' Nama Tengah
           strSQL = "Select Distinct MName from BukuAngKbyQuery " _
             & "Where MName Is Not Null Order By MName"
     Case 4
           ' nickname/julukan
           strSQL = "Select Distinct NickName from BukuAngKbyQuery " _
             & "Where NickName Is Not Null Order By NickName"
      Case Else
   End Select
   
   With Me!cboSelect
       .Value = Null
       .RowSource = strSQL
       .Requery
       .Value = .ItemData(0)
   End With

ExitHere:
   Exit Sub
   
HandleErr:
   Select Case Err
       Case Else
           MsgBox Err & ": " & Err.Description, vbCritical, _
            "Error in Form_FindForm.optChoose_AfterUpdate"
   End Select
   Resume ExitHere
   Resume
End Sub
Signature

H. Frank Situmorang

AccessVandal - 13 Mar 2008 11:32 GMT
Hi Frank,

Is this control an option group or a individual option button?

My guess is that you had the control "optChoose" option group control where
the "Default Value" was set to "1". Try setting it to "0".

Whenever the default is set to "1", you have click on the next option in
order for the event to fire up.

>Hello,
>
>I have a problem in my Find Form that when I chose by Last name, it won't
>work, I have to go to option 2 by Fist name, then to by Last name then it
>works.

Signature

Please Rate the posting if helps you

Frank Situmorang - 13 Mar 2008 12:00 GMT
Thanks Vandar, you are  right, it 's ok now

With many thanks
Signature

H. Frank Situmorang

> Hi Frank,
>
[quoted text clipped - 11 lines]
> >work, I have to go to option 2 by Fist name, then to by Last name then it
> >works.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.