473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Before Update


Io my main form i have a control called ChangePrice and on clkcing i
set the focus
to the control UnitPrice on the subform and enable the editing of the
price.
It cannot work because of the code in the BeforeUpdate event of the
subform which is as follows:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Quantity) Then
MsgBox " You have to fill in either quantity or cartons!", vbCritical
Cancel = True
DoCmd.GoToControl "productid"
Exit Sub
End If
End Sub
Thus,when i click the control Changeprice on the main form i receive
the message
" You have to fill in either quantity or cartons!", vbCritical,from the
BeforeUpdate event.
Can i restrict the action of the Before update event when i click the
control ChangePrice ?
for example
If Parent!CmdChangePrice = true Then
If IsNull(Me.Quantity) Then
MsgBox " You have to fill in either quantity or cartons!", vbCritical
Cancel = True
DoCmd.GoToControl "productid"
Exit Sub
End If
End If

I have tried it but without succes.Where i am wrong ?

==================================
I am trying to resolve it by putting a condition in the Before Update
event:
If Not IsNull(Me.Parent.CmdChangePrice) And IsNull(Me.Quantity) Then
......

But it doesn help.May be i have written it wrong

Nov 13 '05 #1
0 1430

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DTB | last post by:
I am having trouble creating an INSTEAD OF trigger in SQL Server to replicate a BEFORE UPDATE trigger from ORACLE. Here is a sample of the ORACLE BEFORE UPDATE trigger: CREATE TRIGGER myTRIGGER ON...
5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
1
by: Simon Holmes | last post by:
Hi, I am having trouble calling a UDF from a 'before update' trigger whereas I have no problems calling it from the 'after update' trigger. The trigger is as below : CREATE TRIGGER foo NO...
2
by: Jack | last post by:
We are have a question about the no cascade option on before triggers. The description stays that no other triggers will be fired by the changes of a before trigger. One of our developers is...
7
by: Weaver | last post by:
I need to check the status of some records (detail records in a master detail form) _before_ moving off the current master record. Anyone know what event will catch this?
1
by: Rolan | last post by:
Having tried various permutations of Before Update and well for that matter, After Update, OnExit, OnEnter, etc. and also Locked controls, I'm still unable to obtain the intended results. There are...
5
by: wpellett | last post by:
I can not get the SQL compiler to rewrite my SQL UPDATE statement to include columns being SET in a Stored Procedure being called from a BEFORE UPDATE trigger. Example: create table...
7
by: Schmidty | last post by:
Okay...I have another 'newbie' question; I have a function that loads a page and the action is $_SERVER; In the form that is in a function(method?) within a class a variable is passed back to...
5
by: RvGrah | last post by:
I've built a small app to deploy my apps in a small domain, just for my own use when I make small updates to pass to my end users. My app uses File.Copy, and works fine except that it takes a long...
19
by: [david] | last post by:
I'd like to refresh the display before I start the main loop. I have code like this: app = App() app.Show() app.long_slow_init() app.MainLoop()
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.