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 / Macros / November 2007

Tip: Looking for answers? Try searching our database.

Passing Macro value to Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken - 26 Nov 2007 15:32 GMT
In the below Macro, I would like to value of RowCount to be displayed in a
form.

Public Function RunRecordCount()

   Dim dummy As String
   Dim filename As String
   Dim RowCount As Long
   
   filename = "H:\BHTR_GREEKS.TXT"
   
   Open filename For Input As 1
       Do While Not EOF(1)
           Line Input #1, dummy
           If dummy <> "" Then
               RowCount = RowCount + 1
           End If
       Loop
       Close 1

End Function

Please advise.

Could you also provide some websites where I can see sample coding?

Thanks
Jeff Boyce - 26 Nov 2007 20:38 GMT
Ken

Is there a chance you could use Access to link to the file instead?  You
could use a Totals query to get a count, or you could use the DCount()
function, either approach against a linked dataset/table.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> In the below Macro, I would like to value of RowCount to be displayed in a
> form.
[quoted text clipped - 23 lines]
>
> Thanks
Ken - 26 Nov 2007 21:37 GMT
Thanks.... I had forgotten all about the dcount() function..

> In the below Macro, I would like to value of RowCount to be displayed in a
> form.
[quoted text clipped - 23 lines]
>
> Thanks
 
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.