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.

Skiping code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Juan Mack - 29 Mar 2005 21:25 GMT
Ok this is a good one. I have a drop box that get the Manufacturer part
number from a table, it then populates a set of fields using the AfterUpdate
event. I want to display a warning to the user that tells them if the
quantity ordered is greater than the quantity quoted. I basically enable a
box is the condition is true. This code only seems to work if i put a break
on the IF statement to debug it, when I remove the break, then it doesnt
work. Any Ideas? Here is the code im using.

Private Sub ManufPartNumbr_AfterUpdate()

Me.Description.Value = Me.ManufPartNumbr.Column(1)
Me.Cost.Value = Me.ManufPartNumbr.Column(2)
Me.txtqtyquoted.Value = Me.ManufPartNumbr.Column(3)

If Me.txtqtyord.Value > Me.txtqtyquoted.Value Then
Me.qtyWarning.Visible = True
Else
Me.qtyWarning.Visible = False
End If

End Sub
tina - 29 Mar 2005 22:00 GMT
the If statement itself looks okay. when you say it "doesn't work", what
happens:  do you get an error message? or does the statement always evaluate
to True or always evaluate to False, regardless of what the compared values
are? or...?

using the .Value shouldn't make a difference, but you could try beginning
the If statement with

   If Me.txtqtyord > Me.txtqtyquoted Then

alternately, instead of the If statement, you could try

   Me.qtyWarning.Visible = (Me.txtqtyord > Me.txtqtyquoted)

hth

> Ok this is a good one. I have a drop box that get the Manufacturer part
> number from a table, it then populates a set of fields using the AfterUpdate
[quoted text clipped - 17 lines]
>
> End Sub
Juan Mack - 30 Mar 2005 15:39 GMT
hmm same result.. looks like the statement always evaluates to False unless I
have a break. I know what the problem is, the qty quoted value comes from a
sub form, so, when the code runs, this value hasnt been calculated yet, so it
is always 0. Im learning as I go here.. any ideas how I should handle this?

> the If statement itself looks okay. when you say it "doesn't work", what
> happens:  do you get an error message? or does the statement always evaluate
[quoted text clipped - 35 lines]
> >
> > End Sub
tina - 30 Mar 2005 21:50 GMT
from the information you've posted, the best i can do is a general
suggestion:  determine at what point, in the data entry process, that the
qtyquoted value is calculated. then set up the code to run on some event
that *always occurs*, after that point.

hth

> hmm same result.. looks like the statement always evaluates to False unless I
> have a break. I know what the problem is, the qty quoted value comes from a
[quoted text clipped - 40 lines]
> > >
> > > End Sub
 
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.