General discussion

Locked

Access 97 Problem

By MRA2 ·
I have a list of names. When I click on a name the member record comes up. I then use a Command button to bring up the Member's Dependents. If there are NO dependents, I need a message to pop up saying NO Dependents. Ortherwise, the dependent form comes up.

I would gladly email you a copy of the cut down application (876K). I've tried all the regulat things and they don't work. Perhaps bacause I used a subform with the dependents.

Just Email me at abramowitza@coned.com and I will send youthe mdb file.

Thanks so much for any help you can offer....

Alan

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97 Problem

by Gary_W In reply to Access 97 Problem

On click of the command button, do a select to get the count of the dependants.
if count > 0
go to new form
else
display message

Gary

Collapse -

Access 97 Problem

by MRA2 In reply to Access 97 Problem

Poster rated this answer

Collapse -

Access 97 Problem

by MRA2 In reply to Access 97 Problem

Gary,

Give me some sample code for the count and how to address that code in the Visual Basic for Apps code, please.

I have not been able to get that to work....

Collapse -

Access 97 Problem

by dsa In reply to Access 97 Problem

Just use a function that opens the pop up form when there is a dependent and opens the message box if there is none similar to the function I recommended to you before on the postdate. Just call this function in the on_Click event procedure.

Collapse -

Access 97 Problem

by MRA2 In reply to Access 97 Problem

Poster rated this answer

Collapse -

Access 97 Problem

by Bob Sellman In reply to Access 97 Problem

First, determine if there are any dependents:

dim lngCount as Long

lngCount = DCount("[DepName]","[Dependents]","[MemberID]=" & me.txtMemberID)

' me.txtMemberID is the control on your form where you select the member (or the control that contains the member's ID #). If the member ID is a string, remember to surround it with single quotes as in: "[MemberID] ='" & me.txtMemberID & "'"

You can still use the subform. Make a label the size of the subform that says "No Dependents" and put it over the same location as the subform. Set visible property to false. Then make either the subform or the no dependents notice visible as appropriate:

if lngCount = 0 then ' no dependents
me.txtSubForm.visible = false
me.lblNoDep.visible= true
else
me.txtSubForm.visible = true
me.lblNoDep.visible = false
end if

If you want a message to pop up with a separate form, just substitute the code to bring up your pop up form in place of the statements that set the visible properties.

Collapse -

Access 97 Problem

by MRA2 In reply to Access 97 Problem

Poster rated this answer

Collapse -

Access 97 Problem

by MRA2 In reply to Access 97 Problem

This question was closed by the author

Back to Web Development Forum
8 total posts (Page 1 of 1)  

Related Forums