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 / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Required?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kerry - 30 Mar 2005 14:44 GMT
Hi

I have three fields:-
  Type (1 character + or -)
  Bought (currency)
  Sold (currency).  

If the value entered in the type field is + then I would
like the bought field to be required = yes, if the value
in the type field is - then I would like the sold field
to be required=yes.

How can I do this?

Many Thanks

Kerry
Paul B. - 30 Mar 2005 21:11 GMT
Hi Kerry....

I am assuming a bunch of things here, so you will have to modify this.....

If [type]="+" Then
Me.bought.SetFocus
Else If [type] = "-" Then
Me.sold.SetFocus
Else
MsgBox "Please enter a value in Type"
End If

Then in you properties for the bought and sold textboxes, put in the On_Exit
event:

If [bought] <= 0 then
MsgBox "You must enter an amount"
Me.bought.SetFocus
End If
Exit Sub

This is were you check that the user actually entered an amount. Again, I am
assuming things here, so you will have to modify the code to suit your data
types.

HTH

> Hi
>
[quoted text clipped - 13 lines]
>
> Kerry
 
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.