Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / September 2006

Tip: Looking for answers? Try searching our database.

Low on inc pop-up warning on every

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Toolz2life - 31 Aug 2006 17:03 GMT
I am doing a Printer inventory and have two columns, type of cartridge and
the quantity. What I would like to do is when the quantity of each cartridge
goes below 3 when exiting, every time, a pop up warning “Inc is low for
cartridge X. Order more “shows up. So far I have it giving a pop up that
tells when the quantity is low, but want I really want it to do is tell the
type of cartridge that is low at every exit. Can this be done? What would
the coding look like? this what I have now

Private Sub Quantity_AfterUpdate()
If Me.Quantity <= 3 Then
     MsgBox "Printer Inc is low. Order more Inc!"
End If
   
End Sub

This only give me the pop up after up date, but does not tell which
cartridge is low. I am trying to have the code tell me each cartride that is
low at evary exit
 
This is the info, so if HP -10 go under 3 in the inventory a pop up will say
"HP-10 Inc is low. Order more Inc" and it will give the pop -up every time at
exit until the inventory is incressed over 3.
Type of Cartridge    Quantity
HP - 10                       2
HP - 15                       6
Can anyone show me how to get this done?

Thanks

Toolz
Steve Schapel - 31 Aug 2006 19:44 GMT
Toolz,

 MsgBox Me.Type_of_Cartridge & " ink is low!"

Signature

Steve Schapel, Microsoft Access MVP

> I am doing a Printer inventory and have two columns, type of cartridge and
> the quantity. What I would like to do is when the quantity of each cartridge
[quoted text clipped - 26 lines]
>
> Toolz
Toolz2life - 01 Sep 2006 15:52 GMT
OK then, so the code is supposed to look like this:

Private Sub Quantity_Exit(Cancel As Integer)
If Me.Quantity <= 3 Then
    MsgBox Me.Type_of_Cartridge & " ink is low!"
End If
End Sub

I will give it a try.

Thanks

> Toolz,
>
[quoted text clipped - 30 lines]
> >
> > Toolz
Toolz2life - 01 Sep 2006 15:58 GMT
ok! that did tell what cartfride is low, but can i have it tell me all the
cartridge that are low on every exit. Right now it will tell you if the
cartridge is low is you have just reduce it then when exiting will tell you
cartridge is low. Can I have it do that wil out and up date at the exit.

> Toolz,
>
[quoted text clipped - 30 lines]
> >
> > Toolz
Steve Schapel - 01 Sep 2006 20:17 GMT
Toolz,

You mean if there are multiple cartridges in your database which are
"low", and you want the message box to include all of them?  Hmmm, well
that is theoretically possible, but I would suggest that a MsgBox is not
really the appropriate approach with this.  I would try it like this
instead...
Make a query based on your table, with a Criteria <4 in the Quantity field.
Make a continuous view Form based on this query.
On the After Update event of the existing form (not the Quantity
control), put code like this...
 Private Sub Form_AfterUpdate()
   If DCount("*","YourQuery") > 0 Then
      DoCmd.OpenForm "Your New Form"
   End If
 End Sub

For the record, to do it with the MsgBox idea, the code would be
something like this...
 Private Sub Quantity_Exit(Cancel As Integer)
   Dim rst as DAO.Recordset
   Dim MessageText As String
   Me.Dirty = False
   Set rst = CurrentDb.OpenRecordset("SELECT [Type of Cartridge] FROM
YourTable WHERE Quantity < 4")
   Do Until rst.EOF
       MessageText = MessageText & rst![Type of Cartridge] & vbCrLf
       rst.MoveNext
   Loop
   rst.Close
   If Len(MessageText) Then
         MsgBox "Ink is low:" & vbCrLf & MessageText
   End If
   Set rst = Nothing
 End Sub

Signature

Steve Schapel, Microsoft Access MVP

> ok! that did tell what cartfride is low, but can i have it tell me all the
> cartridge that are low on every exit. Right now it will tell you if the
> cartridge is low is you have just reduce it then when exiting will tell you
> cartridge is low. Can I have it do that wil out and up date at the exit.
Toolz2life - 06 Sep 2006 16:35 GMT
Steve,
Thank for the for the info. I am trying it with the Msbox and I am putting
the code in and when i run the program i am getting a syntax error at the
point "("SELECT [Type of Cartridge] FROM YourTable WHERE Quantity < 4")".
Where you put "FROM YourTable WHERE Quantity" I delet that and put the name
of the table by it self, which is Quantity. I know a little code-in but not
enough to know what i am doing wrong.

Thank,

Toolz

> Toolz,
>
[quoted text clipped - 36 lines]
> > cartridge is low is you have just reduce it then when exiting will tell you
> > cartridge is low. Can I have it do that wil out and up date at the exit.
Steve Schapel - 18 Sep 2006 09:21 GMT
Toolz,

Can you please post back with the complete code you are using?

Signature

Steve Schapel, Microsoft Access MVP

> Steve,
> Thank for the for the info. I am trying it with the Msbox and I am putting
[quoted text clipped - 3 lines]
> of the table by it self, which is Quantity. I know a little code-in but not
> enough to know what i am doing wrong.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.