Answer please!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, it is simple but I don't know whats wrong I am doing

If x>y then
Msgbox(" ------")
end if

this is simple thing and than I want value of x to be either "0" or "empty
box"
The first part works fine it give me msg thing, but than I don't know how
should ask mr. computer to leave that box empty. one more thing x and y are
integer values.

and I am not getting how should I do this. I am new to this code as well. I
will be thankful, if someone can hlep me.

Thanking in advance
Rathi
 
Hi
thanks vladmir for your response, but it gives me an error messege. And also
what if I want to keep the box empty ?
 
Hi, it is simple but I don't know whats wrong I am doing

If x>y then
Msgbox(" ------")
end if

this is simple thing and than I want value of x to be either "0" or "empty
box"
The first part works fine it give me msg thing, but than I don't know how
should ask mr. computer to leave that box empty. one more thing x and y are
integer values.

You are being very unclear here.

This code will not do ANYTHING to either X or Y. It will just post a
message.

As Vladimir says, if you want the message to appear if x is less than
y, *or* if x is NULL (blank, empty), then

If NZ(x, 0) < y Then
Msgbox("...")
End If

will work.

But your question about "leaving that box empty" makes no sense; if
the box is empty when you run this code it will be empty afterward,
and if it's not, it will be unchanged afterward.

Could you explain the context? Is this on a Form? Where is the code
being called from? And what are you trying to accomplish?

John W. Vinson [MVP]
 
Thanks John for your interest and support. I think I have cleared my doubt.
As I am new in database I am just struggling a bit

One more question if you can answer please

I am having this database with the startup form which pops up when the
database is opened. If you click OK then it will show you main switchboard
and all those things (whole database basically) and if no then it will shut
dwon the database - which is fairly easy thing to do I guess.

But what I want is, the user of the database unable to browse through
without clicking OK. Basically everything should be inactive as long as that
startup form is active. I hope it clear. I will appreciate if you can help me
on this.

Thanking in advance
Rathi
 
But what I want is, the user of the database unable to browse through
without clicking OK. Basically everything should be inactive as long as that
startup form is active. I hope it clear. I will appreciate if you can help me
on this.

If you set the form's Modal property to Yes, the user will not be able
to do anything until the form is closed or made invisible. Set its
Close Button property to No, along with the Min/Max buttons as well.

In a user-ready application you should probably also turn off the
database window (Tools... Startup... uncheck Display Database Window)
so they cannot look directly at tables or queries, only at the forms
that you have provided. Of course this means that you must provide
them with all of the tools that they need in order to use the database
productively - not least, an Exit button to let them out!

John W. Vinson [MVP]
 
thanks john it worked, cheers

John W. Vinson said:
If you set the form's Modal property to Yes, the user will not be able
to do anything until the form is closed or made invisible. Set its
Close Button property to No, along with the Min/Max buttons as well.

In a user-ready application you should probably also turn off the
database window (Tools... Startup... uncheck Display Database Window)
so they cannot look directly at tables or queries, only at the forms
that you have provided. Of course this means that you must provide
them with all of the tools that they need in order to use the database
productively - not least, an Exit button to let them out!

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top