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 / April 2008

Tip: Looking for answers? Try searching our database.

To have a selection of year to merge

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

In my Form there is a commandkey to merge to the All records and below is
the VBA, my question is how can we make it like a combo box to chose the
year, because the user is not a programmer, and is not able to open it in
design view and change the VBA.

Private Sub cmdMergeAll_Click()
 
  Me.Refresh
  MergeAllWord ("select * from PelayanJemaat Where TahunPel=2008")
     'Note that you could use a condtion in the above sql
End Sub

Thanks in advance for any help provided.
Signature

H. Frank Situmorang

Klatuu - 05 Mar 2008 15:33 GMT
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.
 
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.