I have an Access form that I want to distribute to users who do not have Access. I do not have Microsoft Office Developer or this would be easy.
The form allows the user to filter records based on date of birth, soc sec nbr or any other field on the form. I tried creating a data access page, but I can't filter by form on the data access page.
I also tried creating a form in VB6 using the Access database. I was able to create the form, but I don't know much about coding, and I was not able to replicate the filter by form feature? Anyone with any ideas? I could really use some help!!!!!!!!!!!!!!
I am not sure if you are using the recordset object or the ado data control. Try the following - select project-references-ms ado objects 2.x and look at the following code - it is from a ms help file - Your strCnn will be different since you are using ms access:
Dim rstPublishers As ADODB.Recordset
Dim rstPublishersCountry As ADODB.Recordset
Dim strCnn As String
Dim intPublisherCount As Integer
Dim strCountry As String
Dim strMessage As String
' Open recordset with data from Publishers table.
strCnn = "Provider=sqloledb;" & _
"Data Source=srv;Initial Catalog=pubs;User Id=sa;Password=; "
Set rstPublishers = New ADODB.Recordset
rstPublishers.CursorType = adOpenStatic
rstPublishers.Open "publishers", strCnn, , , adCmdTable
' Populate the Recordset.
intPublisherCount = rstPublishers.RecordCount
' Get user input.
strCountry = Trim(InputBox( _
"Enter a country to filter on:"))
If strCountry <> "" Then
' Open a filtered Recordset object.
Set rstPublishersCountry = _
FilterField(rstPublishers, "Country", strCountry)
If rstPublishersCountry.RecordCount = 0 Then
MsgBox "No publishers from that country."
' Print number of records for the original
' Recordset object and the filtered Recordset
strMessage = "Orders in original recordset: " & _
vbCr & intPublisherCount & vbCr & _
"Orders in filtered recordset (Country = '" & _
strCountry & "'): " & vbCr & _