is it possible to run two functions in the same event?

  • Thread starter Thread starter fishqqq
  • Start date Start date
F

fishqqq

I think this should be possible but i'm not certain.

i have a form what i want the after update command to go to a field and
insert some information. i know how to write the code to do this. i
would like the code to also go to another field and insert some info
there too. i don't know how to join the two together in one event?

i'm using the Me.fieldname command to start off but it will only update
the 1st field not the 2nd.

any suggestions are greatly appreciated.
 
You can do just about anything you want in an event. If it is not working
for you, you have some other problem with the code. If you would like to
post it here, we could have a look at it.
 
Tks , here's the code with the problem.
I get a Compile Error:Method or data member not found. and it
references [Combo235].

i'd appreciate your feedback.


Private Sub Combo235_AfterUpdate()
Me.Notes__internal_tracking_ = Now() & " - " & Forms![Shipment Tracking
II]![fCurrentUser]![USER CODE] & " - " & "*** " & [Combo235] & " ***" &
" - " & "" & vbCrLf & Me.Notes__internal_tracking_

Me.Notes__internal_tracking_.SetFocus
Me.Notes__internal_tracking_.SelStart = 27

Me.Notes_ = Now() & " - " & Forms![Shipment Tracking
II]![fCurrentUser]![USER CODE] & " - " & "*** " & [Combo235] & " ***" &
" - " & "" & vbCrLf & Me.Notes_

Me.Notes_.SetFocus
Me.Notes_.SelStart = 27

DoCmd.RunMacro "Shipment Tracking.update status"

End Sub

2. Klatuu
Jan 18, 5:50 pm show options

Newsgroups: microsoft.public.access.formscoding
From: Klatuu <[email protected]> - Find messages by this
author
Date: Wed, 18 Jan 2006 14:50:01 -0800
Local: Wed, Jan 18 2006 5:50 pm
Subject: RE: is it possible to run two functions in the same event?
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

You can do just about anything you want in an event. If it is not
working
for you, you have some other problem with the code. If you would like
to
post it here, we could have a look at it.
 
Tks , here's the code with the problem.
I get a Compile Error:Method or data member not found. and it
references [Combo235].

i'd appreciate your feedback.


Private Sub Combo235_AfterUpdate()
Me.Notes__internal_tracking_ = Now() & " - " & Forms![Shipment Tracking
II]![fCurrentUser]![USER CODE] & " - " & "*** " & [Combo235] & " ***" &
" - " & "" & vbCrLf & Me.Notes__internal_tracking_

Me.Notes__internal_tracking_.SetFocus
Me.Notes__internal_tracking_.SelStart = 27

Me.Notes_ = Now() & " - " & Forms![Shipment Tracking
II]![fCurrentUser]![USER CODE] & " - " & "*** " & [Combo235] & " ***" &
" - " & "" & vbCrLf & Me.Notes_

Me.Notes_.SetFocus
Me.Notes_.SelStart = 27

DoCmd.RunMacro "Shipment Tracking.update status"

End Sub

2. Klatuu
Jan 18, 5:50 pm show options

Newsgroups: microsoft.public.access.formscoding
From: Klatuu <[email protected]> - Find messages by this
author
Date: Wed, 18 Jan 2006 14:50:01 -0800
Local: Wed, Jan 18 2006 5:50 pm
Subject: RE: is it possible to run two functions in the same event?
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

You can do just about anything you want in an event. If it is not
working
for you, you have some other problem with the code. If you would like
to
post it here, we could have a look at it.


Try getting rid of the brackets on Combo235 in your expressions.



--
 
If Combo235 is a control on your form, you need to reference just like you do
with
Me.Notes__internal_tracking_.
Me.Combo235
 
Klatuu
Jan 20, 8:05 am show options

Newsgroups: microsoft.public.access.formscoding
From: Klatuu <[email protected]> - Find messages by this
author
Date: Fri, 20 Jan 2006 05:05:03 -0800
Local: Fri, Jan 20 2006 8:05 am
Subject: Re: is it possible to run two functions in the same event?
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

If Combo235 is a control on your form, you need to reference just like
you do
with
Me.Notes__internal_tracking_.
Me.Combo235



- Hide quoted text -
- Show quoted text






This still gives me a compile error. I"m not sure what to do?


Private Sub Combo235_AfterUpdate()
Me.Notes__internal_tracking_ = Now() & " - " & Forms![Shipment Tracking
II]![fCurrentUser]![USER CODE] & " - " & "*** " & Combo235 & " ***" & "
- " & "" & vbCrLf & Me.Notes__internal_tracking_

Me.Notes__internal_tracking_.SetFocus
'Me.Notes__internal_tracking_.SelStart = 27
Me.Notes__internal_tracking_.SelStart =
Len(Me!Notes__internal_tracking) + 1
Me.Combo235

DoCmd.RunMacro "Shipment Tracking.update status"

End Sub
 
Back
Top