Amateur Question on Access VBA


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Amateur Question on Access VBA

  1. #1
    Join Date
    Dec 2007
    Posts
    2

    Amateur Question on Access VBA

    Afternoon All.

    I bet this probably comes off as a really newbish question, but I'm completely stuck!

    I'm using VBA in Access 2000, and i'm trying to create an IF statement on an Access Form. What I'd like to do is create the statement using the field (Stock Level) from the Table 'tblStock'. I'd like it so that when Stock Level is equal to 0, a Message Box opens and says the name of the Product (Which is located in the Product field of tblStock).

    I have the If code working with regular numbers, but I can't use it with data that can be found within fields that I've created.

    Any help would be appreciated for a lifetime!

    Thanks!

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Welcome to DevX

    Are you familiar with SQL? Specifically (for this case) SELECT statements?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Dec 2007
    Posts
    2
    I know dibs and dabs of SQL, but i'm afraid not in this scenario.

    Thanks though, websites like this are always incredibly helpful!

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Well, a SELECT query would return the stock level from the database.

    That return would be stored in a variable and compared to whatever you are using on your form to deal with stock.

    Transactions that took stock out or put stock in would either increment or decrement that value, and write the new value back using an UPDATE query.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Access printout question. A new user.
    By alaska_eric in forum VB Classic
    Replies: 1
    Last Post: 03-15-2005, 05:31 PM
  2. Access Database Question
    By MKayHavoc in forum VB Classic
    Replies: 5
    Last Post: 03-09-2005, 02:09 AM
  3. MS Access Simple question.......
    By vinman in forum VB Classic
    Replies: 3
    Last Post: 02-22-2001, 11:40 PM
  4. MS Access Simple question.......
    By dave in forum VB Classic
    Replies: 3
    Last Post: 02-19-2001, 08:07 PM
  5. Data Access Pages to Emulate Website on CD
    By John Simmons in forum Enterprise
    Replies: 0
    Last Post: 02-09-2001, 01:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center