Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form?

Status
Not open for further replies.

NewStudent

Programmer
Nov 8, 2002
12
0
0
IR
Hello,

Hope someone help it.

When I click buttom to link to other form, if the form is no data available, i want to show up a message box.

The things that I don't know where I should to write code.
For buttom "onclick" or the forms?

Rong
 
In the OnClick event of the button perform an if/then and a DCount on the query/table supplying the data to your popup form.
[tt]
If DCount("[MyField]","MyTable","[Criteria]=[MyCriteria]") > 0 Then
DoCmd.OpenForm "MyForm"
Else
MsgBox "No records match!"
End If
[/tt]

HTH Joe Miller
joe.miller@flotech.net
 
Public Sub Button_OnClick()
DoCmd.OpenForm "otherForm"
End Sub

'-----------otherForm-----------------
Public Sub Form_Load()
'check for data
'if no data
MsgBox "No Data"
'end if
End Sub

Hope that's what you're looking for
 
JoeMiller,SIG357,

Thank you very much for your kind help. I am realy new student about MS Access. I got it and please share my happiness with you. This is my first project for this summer course.

Thanks again and have a good weekend.

Rong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top