Passing Macro value to Form

K

Ken

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
 
J

Jeff Boyce

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
 

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