to make find form works on form based on the grid query

F

Frank Situmorang

Hello,

I need your help in order to finish developping my church membership
database. my problem is as follows:

My form is based on grid query, how can I make find form work using
parameter query like the one on the addressbooks sample of access data base.

This is my VBA it works but some fields become distorted to have value like
" name etc.

DoCmd.OpenForm "formbukuang"
With Forms!formbukuang
If Len(Me!cboSelect & "") > 0 Then
' Construct SQL for Bukuangkby's Recordsource
Select Case optChoose
Case 1
' last name di bukuanggotakby
mstrSQL = "SELECT * FROM bukuangkby Where " _
& " LName Like '*" & DoubleQuote(Me![cboSelect]) & "*'"
Case 2
' first name
mstrSQL = "SELECT * FROM bukuangkby Where " _
& " FName Like '*" & DoubleQuote(Me![cboSelect]) & "*'"
Case 3
' Middle name
mstrSQL = "SELECT * FROM bukuangkby Where " _
& " MName Like '*" & DoubleQuote(Me![cboSelect]) & "*'"
Case 4
' nickname
mstrSQL = "SELECT * FROM bukuangkby Where " _
& " Nickname Like '*" & DoubleQuote(Me![cboSelect]) &
"*'"
Case Else
End Select
.RecordSource = mstrSQL
!cmdFind.Caption = "&Show All"
If optChoose = 1 Then
!TabbukuAnggota.Value = 0
Else
!TabbukuAnggota.Value = 0
End If
Else
.RecordSource = "bukuangkby"
End If
End With
DoCmd.Close acForm, "FindForm"

Thanks in advance
 

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