Web Development
7 replies
by kevin.riggs
PART 1
Are you using ADO recordsets to return the records? If so, you can test against the RecordSet.RecordCount. If it is < 1 then you can display the messagebox. If you're not using ADO recordsets, please write how you're returning the records.
PART 2
If you want to open the window as modal then the user will have to deal with the first window before the 2nd is displayed.
An example:
If rs.RecordCount > 0 Then
frmReport1.Show vbModal
frmReport2.Show vbModal
Else
MsgBox "Error: blah, blah, blah", vbOKOnly
End If
by bambamz
by bambamz
Currently I have a form up and I input a SSN, it auto fills in the name. Then I click on a button that says Call History. With this event.
Dim stLinkCriteria As String
stLinkCriteria = "[SSN]=" & "'" & Me![dacalls.SSN] & "'"
DoCmd.OpenForm "FrmDAHistory", , , stLinkCriteria
DoCmd.OpenForm "FrmHistory", , , stLinkCriteria
these two forms come up whether there is information or not. The forms are built off of queries that query all of the calls in two different tables. So all I want to do is not have the form open and have a message display if there is no record found in the table.
by bob sellman
I'd suggest setting up a form using tabs. On the footer (or header if you prefer), you can have the SSN input and auto name display. The two tabs would be DA History and History. Each tab would have the appropriate subform (frmDAHistory or FrmHistory). Each subform would be linked to the main form by the SSN.
You wouldn't even need a Call History button. Just set the OnUpdate property of the SSN control on the main form to requery the two subform controls (after you make any appropriatechecks to be sure the SSN entered by the user is valid).
You might also want to set the subform controls visible property to false so they are not displayed when the form is opened. After a valid SSN is entered, make them visible and requery them. If an invalid SSN is entered, reset the two subform controls visible property to false.
This avoids having a bunch of forms opening at the same time. If there are no matching records for one of the tabs, then there will be no data displayed in that subform. But everything still will occur within the one form.
I've found that users relate fairly well to tabbed forms because of the analogy to file folders and because the concept is used elsewhere in Windows.
by bambamz
by bambamz
by bambamz
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending