PC Review


Reply
Thread Tools Rate Thread

HOW CAN I VERIFY WHEN WITHDRAWING AN ITEM FROM A STORAGE IF IT EXISTS IN THE STORAGE?

 
 
Chris
Guest
Posts: n/a
 
      24th May 2004
I have a database for an existing stock in a warehouse. I made a table with
the entries in the storage, and a query with the total of materials which
are in the repository at a moment, for each name of the material, quality
dimension, measurement unit and price.
Now, I want to take some materials out of the storage. I want to a table
for them, but HOW CAN I VERIFY WHEN I ADD A MATERIAL IN THAT TABLE IF THIS
MATERIAL IS (EXISTS) IN THE STORAGE (if I have entries for it) and to GET AN
ERROR MESSAGE IF I DON'T HAVE IT IN THE STORAGE?

I would apreciate any help.
Thank you!


 
Reply With Quote
 
 
 
 
MacDermott
Guest
Posts: n/a
 
      24th May 2004
Look at the DLookup() function.

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a database for an existing stock in a warehouse. I made a table

with
> the entries in the storage, and a query with the total of materials which
> are in the repository at a moment, for each name of the material, quality
> dimension, measurement unit and price.
> Now, I want to take some materials out of the storage. I want to a table
> for them, but HOW CAN I VERIFY WHEN I ADD A MATERIAL IN THAT TABLE IF THIS
> MATERIAL IS (EXISTS) IN THE STORAGE (if I have entries for it) and to GET

AN
> ERROR MESSAGE IF I DON'T HAVE IT IN THE STORAGE?
>
> I would apreciate any help.
> Thank you!
>
>



 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      31st May 2004
I am not sure I understand how to use the DLookup() function.
How can I use multiple criteria for the DLookup function in the validation
rule for a control on a form?(Ex:For every control except the first one,
the values for the precedent controls from the form are equal with the
fields having the same name in a query)
Can you PLEASE give me an example?

"MacDermott" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Look at the DLookup() function.
>
> "Chris" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I have a database for an existing stock in a warehouse. I made a table

> with
> > the entries in the storage, and a query with the total of materials

which
> > are in the repository at a moment, for each name of the material,

quality
> > dimension, measurement unit and price.
> > Now, I want to take some materials out of the storage. I want to a

table
> > for them, but HOW CAN I VERIFY WHEN I ADD A MATERIAL IN THAT TABLE IF

THIS
> > MATERIAL IS (EXISTS) IN THE STORAGE (if I have entries for it) and to

GET
> AN
> > ERROR MESSAGE IF I DON'T HAVE IT IN THE STORAGE?
> >
> > I would apreciate any help.
> > Thank you!
> >
> >

>
>



 
Reply With Quote
 
MacDermott
Guest
Posts: n/a
 
      31st May 2004
Gee, that sounds like a pretty different question to me -
Guess I don't have a very clear picture of what you're trying to do.
Let me mention a couple of things which may or may not be what you're
looking for:

1. You can put multiple criteria in a DLookup() by using AND, e.g.
DLookup("MyField","MyTable","Key1=2 AND Key2=25")

2. You can build a criteria string and use it in DLookup(), e.g.
Dim MyString as String
MyString="Key1=2"
MyString=MyString & " AND " & "Key2=25"
...DLookup("MyField","MyTable",MyString) 'Note no quotes around
variable name

3. Access doesn't very readily support an order of the controls on a form;
the MyForm.Controls collection is indexed only by the order in which
controls were put on the form, and this can't be changed. This may (or
more likely may not) be exactly the order you have in mind when you speak of
"previous controls".

4. What you ask is relatively complex. You should probably be looking at
running code in your control's Before Update event, rather than writing
validation rules.

5. It's generally unwise to base a validation rule on values in other
controls. A validation rule prevents you from leaving the current control;
if the problem is a value in a different control, you can't get to that
control to make the change - so you're pretty much stuck.

6. In a bound form, the value of a control is always equal to the value of
its controlsource, which is often the field having the same name in the
query.

Hope some of this helps...
- Turtle

"Chris" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I am not sure I understand how to use the DLookup() function.
> How can I use multiple criteria for the DLookup function in the validation
> rule for a control on a form?(Ex:For every control except the first one,
> the values for the precedent controls from the form are equal with the
> fields having the same name in a query)
> Can you PLEASE give me an example?
>
> "MacDermott" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > Look at the DLookup() function.
> >
> > "Chris" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I have a database for an existing stock in a warehouse. I made a table

> > with
> > > the entries in the storage, and a query with the total of materials

> which
> > > are in the repository at a moment, for each name of the material,

> quality
> > > dimension, measurement unit and price.
> > > Now, I want to take some materials out of the storage. I want to a

> table
> > > for them, but HOW CAN I VERIFY WHEN I ADD A MATERIAL IN THAT TABLE IF

> THIS
> > > MATERIAL IS (EXISTS) IN THE STORAGE (if I have entries for it) and to

> GET
> > AN
> > > ERROR MESSAGE IF I DON'T HAVE IT IN THE STORAGE?
> > >
> > > I would apreciate any help.
> > > Thank you!
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Storage Volumes for multi storage cards missing Larry Windows XP Configuration 2 4th Nov 2006 05:31 AM
Re: FREE STORAGE SERVICE - 100 megabytes of storage space on the internet knectar@gmail.com Storage Devices 0 14th Dec 2004 11:26 AM
HOW CAN I VERIFY WHEN WITHDRAWING AN ITEM FROM A STORAGE IF IT EXISTS IN THE STORAGE? Chris Microsoft Access 3 31st May 2004 11:09 AM
HOW CAN I VERIFY WHEN WITHDRAWING AN ITEM FROM A STORAGE IF IT EXISTS IN THE STORAGE? Chris Microsoft Access Forms 3 31st May 2004 11:09 AM
HOW CAN I VERIFY WHEN WITHDRAWING AN ITEM FROM A STORAGE IF IT EXISTS IN THE STORAGE? Chris Microsoft Access Form Coding 3 31st May 2004 11:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:29 PM.