popup form? (1 Viewer)

mregina

Registered User.
Local time
Today, 03:39
Joined
May 5, 2006
Messages
10
I'm working on an invoice system for a company and they reqiure notification when an account is called up on a form that has an outstanding invoice.

So I created a query that locates all unpaid invoices, I made a form using that query, and I want to use it as a subform on my main invoice page.

But I'd like this subform to only popup when the criteria is met, that is the name on the subform matches the name on the current invoice called up.

Right now the subform is blank when the criteria is not met, and fields are filled out when they are...but I'd rather a nice big popup that can really get their attention...any idea if this is possible on Access 2000?

Thanks!
 

CEH

Curtis
Local time
Today, 02:39
Joined
Oct 22, 2004
Messages
1,187
How bout setting the subform visible to False. Then if your criteria is met have the code change the visible to True.
 

mregina

Registered User.
Local time
Today, 03:39
Joined
May 5, 2006
Messages
10
Ceh

That sounds like it could work however I'm not that well versed in writing code to do it.
 

CEH

Curtis
Local time
Today, 02:39
Joined
Oct 22, 2004
Messages
1,187
Well, I can give a shot at some aircode :)
First thing is to set your subform visible to NO. Dont click inside the subform, click the border,then right click, pick properties.(that was alwats tricky to me:))
Then for example if you have a textbox where your criteria is returned if it is there.... say [txtResults] ..... I would pick whatever executes your query...... say a command button..

CommandButton_Click()
If Not isnull(txtResults) then
me.SubformName.visible = true
else me.Subform.visible = False
endif
end sub

Try that.........
 

mregina

Registered User.
Local time
Today, 03:39
Joined
May 5, 2006
Messages
10
thanks, working on it...seems iffy...either the popup appears all the time or doesnt appear at all. Does the code you wrote need to be entered in the form or subform?
 

workmad3

***** Slob
Local time
Today, 08:39
Joined
Jul 15, 2005
Messages
375
it should be in the code for the command button, or wherever the code is that has the critera you want to make it visible for.
 

mregina

Registered User.
Local time
Today, 03:39
Joined
May 5, 2006
Messages
10
ok I have it working when I press a button...but I'd like it to work when the page loads up..I tried changing the criteria to 'on load' 'on change' 'on focus' ect..and nothing happens sadly..
 

workmad3

***** Slob
Local time
Today, 08:39
Joined
Jul 15, 2005
Messages
375
what code are you using for the criteria? If it is for a bound control, the on current event is probably the correct event to use.
 

mregina

Registered User.
Local time
Today, 03:39
Joined
May 5, 2006
Messages
10
This is what I have

Private Sub Main_Contacts_AfterUpdate()
If Not IsNull(BillAddress_Addr1) Then
Me.qrySalesRepByDate_long_UNPAID.Visible = True
Else: Me.qrySalesRepByDate_long_UNPAID.Visible = False
End If
 

workmad3

***** Slob
Local time
Today, 08:39
Joined
Jul 15, 2005
Messages
375
Try it in the Current event of the form as a possiblity.

Also,

Me.qrySalesRepByDate_long_UNPAID.Visible = Not IsNull(BillAddress_Addr1)

can be used to replace your if statement, if you want to reduce your code down :)
 

mregina

Registered User.
Local time
Today, 03:39
Joined
May 5, 2006
Messages
10
gahhh NO idea why it is not working...either the subform appears for all invoices (and is blank for those where the criteria is not met) or it doesn't appear for ANY invoices (even those where the citeria is met)....

so I have decided to create a button called 'verify account' which can show my users ythe popup if needed...but now the form is acting odd and won't allow me to add a 'close form' button on it...gahhhh!!

Thanks for all your help guys...any other ideas and I'll try them out...going for a breather before my monitor ends up out the window :)
 

CEH

Curtis
Local time
Today, 02:39
Joined
Oct 22, 2004
Messages
1,187
It should work fine if you put the same code on the forms OnCurrent event also.
If not post your DB
 

Users who are viewing this thread

Top Bottom