[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Subform record count check

Posted on 2006-03-21
1
Medium Priority
?
1,820 Views
Last Modified: 2008-01-09
Access 97/2000/2003

From a Command button...


I have a subform that I'am getting data from and posting onto my main form..

In the Subform I need to see if the record count > 0  before I do this.

Need a msgbox to say ...  "Zero records. Try Again"



Private Sub cmdPost_Click()

' AUTO POSTING IF VALUES IN SUBFORM
 Dim strForm As String
strForm = "qryBarnes subform"
Dim z
Me.qryBarnes_subform.SetFocus
z = nextTextPost(Me.Controls(strForm)![CompetitorNumber] & "|" & Me.Controls(strForm)![tblXrefSku.Grng] & "|" & Me.Controls(strForm)![Noun] & " " & Me.Controls(strForm)![Size] & "|" & " |" & Me.Controls(strForm)![CompetitorName] & "|" & Me.Controls(strForm)![CompetitorNumber])
Me.fldMfrnum.SetFocus
End Sub

Thanks
fordraiders

0
Comment
Question by:Fordraiders
1 Comment
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 2000 total points
ID: 16247145
If Me("qryBarnes_subform").Form.Recordset.RecordCount>0 Then
    'Do your stuff

End If

(Post 97 only.  Otherwise...
If Me("qryBarnes_subform").Form.Recordsetclone.RecordCount>0 Then
)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question