[AccessD] Form Before Update

Stuart McLachlan stuart at lexacorp.com.pg
Fri Sep 2 00:40:43 CDT 2005


On 1 Sep 2005 at 20:37, Francisco Tapia wrote:

> It couldn't be simpler than this, the form is bound to a view, the view 
> source is 
> "Select * From MyTable Where ADE <> 3"
> 
> When the button is clicked it automatically fires the form's before 
> update... ARG... 

That's because you tell it to fire the update with  Me.Form.Refresh.

 <quote>
The Refresh method immediately updates the records in the underlying record 
source for a specified form or datasheet to reflect changes made to the 
data by you and other users in a multiuser environment.
</quote>


>the before update runs a CheckRRNumber function which 
> checks the current line's information, that way I can assign the current 
> line an RR number when the line item is created, if the current line has the 
> same sn as another lineitem in the list, then I populate the RR number with 
> the pre-existing number. "IF" the SN of the new line is diffrent then I make 
> a round trip to the server to purchase a new line item. 
> 
> Private Sub cmdDELETE_Click()
> Me.txtADE = 3
> Me.Form.Refresh
> End Sub
> 
> Private Sub Form_BeforeUpdate(Cancel As Integer)
> If Nz(Me.txtCPN, "") <> "" Then
> CheckRRNumber
> Else
> Cancel = True
> Me.Undo
> End If
> End Sub
> 
> On 9/1/05, Stuart McLachlan <stuart at lexacorp.com.pg> wrote:
> > 
> > On 1 Sep 2005 at 11:55, Francisco Tapia wrote:
> > 
> > > Thanks for the response... but the event is actually the Form's
> > > BeforeUpdate, I tried txtADE.text but that doesnt work either. This
> > > whole process occurs from a command button that I use to mark a hidden
> > > textbox w/ a 3, so when it receives the new value, I get the
> > > before_update (on the form) firing.
> > >
> > 
> > How about posting the relevant snippets of the button, textbox and form
> > events so that we can see exactly what you are talking about.
> > 
> > --
> > Stuart
> 
> 
> 
> 
> -- 
> -Francisco
> http://pcthis.blogspot.com |PC news with out the jargon!
> http://sqlthis.blogspot.com | Tsql and More...
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 

-- 
Stuart





More information about the AccessD mailing list