Put a control on your form where the user can enter the date. For example
purposes, I will call it txtMergeYear
Private Sub cmdMergeAll_Click()
Dim lngMergeYear As Long
If IsNull(Me.txtMergerYear) Then
MsgBox "A Year is Required"
Exit Sub
Else
lngMergeYear = Clng(Me.txtMergeYear)
End If
Me.Refresh
MergeAllWord ("select * from PelayanJemaat Where TahunPel= " &
lngMergeYear)
'Note that you could use a condtion in the above sql
End Sub

Signature
Dave Hargis, Microsoft Access MVP
> Hello,
>
[quoted text clipped - 11 lines]
>
> Thanks in advance for any help provided.
Frank Situmorang - 06 Mar 2008 03:18 GMT
Thanks very much Klatuu, I will try it

Signature
H. Frank Situmorang
> Put a control on your form where the user can enter the date. For example
> purposes, I will call it txtMergeYear
[quoted text clipped - 29 lines]
> >
> > Thanks in advance for any help provided.
Frank Situmorang - 06 Mar 2008 03:56 GMT
Klatuu,
How if txtMergerYear, we use combo in the form, to be user friendly. What is
the VBA.
Thanks in advance for your help

Signature
H. Frank Situmorang
> Put a control on your form where the user can enter the date. For example
> purposes, I will call it txtMergeYear
[quoted text clipped - 29 lines]
> >
> > Thanks in advance for any help provided.
Klatuu - 06 Mar 2008 16:01 GMT
I'm not convinced a combo is more user friendly in this case, but it wouldn't
need to be any VBA, just make your Row Source Type a Value List and enter a
range of years:
1999;2000;2001;2002;2003;2004;2005;2006;2007;2008;2009;2010

Signature
Dave Hargis, Microsoft Access MVP
> Klatuu,
>
[quoted text clipped - 36 lines]
> > >
> > > Thanks in advance for any help provided.
Frank Situmorang - 02 Apr 2008 09:00 GMT
Klatuu:
I have tried your suggestion but it can not work.
Let me provide you additional formation.
My MergeSingleWord button is in the form when we fill in the name of the
chruch officer, the year of service and it can perfecly work.
In the same form I put a button of MergeAll. and then to do your seggestion
I put a textbox on it for the txtMergerYear like you said.
But when it comes to give the rowsource of this textbox, how can it be,
because the table based of this form will not enable us to put the value list
in the textbox.
I appreciate your help.

Signature
H. Frank Situmorang
> I'm not convinced a combo is more user friendly in this case, but it wouldn't
> need to be any VBA, just make your Row Source Type a Value List and enter a
[quoted text clipped - 42 lines]
> > > >
> > > > Thanks in advance for any help provided.
Klatuu - 02 Apr 2008 15:01 GMT
I don't see why it would not work. Your original code:
MergeAllWord ("select * from PelayanJemaat Where TahunPel=2008")
Using a combo box to select the year, it would be:
MergeAllWord ("select * from PelayanJemaat Where TahunPel=" & Me.YearCombo)

Signature
Dave Hargis, Microsoft Access MVP
> Klatuu:
>
[quoted text clipped - 59 lines]
> > > > >
> > > > > Thanks in advance for any help provided.