Trying to place 2 after update procedures in 1 combo box

G

Guest

Hello
I currently have a combo box that is bound to a table with 2 fields and has
4 different options/records in it, with an after update procedure, that has
different calculations for each record. I want to add a Dlookup command that
will display
the record that is chosen in another text box and it will need to be placed
in the
after update procedure of the combo box also. Is this possible?

Code that is currently in the after update procedure of the combo box.

Dim prp As Property, ctl As Control

Set prp = Me!cboRidge.Properties("ListIndex")
Set ctl = Me.txtRidgetot

If prp = 0 Then
ctl = ([txtridge]*100/30)+0.4
ElseIf prp = 1 Then
ctl = ([txtridge]*100/45)+0.4
ElseIf prp = 2 Then
ctl = ([txtridge]*100/30)+0.4
Else
ctl = ([txtridge]*100/30)+0.4
End If

Set ctl = Nothing
Set prp = Nothing

Code I need to add: (2nd after update procedure)

Me.Dlookfelts.Requery


Thanks-- any help will be very appreciated.
 
G

Guest

Hello Patentinv,

Try the following instead:

Option Compare Database
Option Explicit

Private Sub cboRidge_AfterUpdate()
On Error GoTo ProcError

Select Case Me.cboRidge
Case 0
Me.txtRidgetot = (Me.txtridge * 100 / 30) + 0.4
Case 1
Me.txtRidgetot = (Me.txtridge * 100 / 45) + 0.4
Case 2
Me.txtRidgetot = (Me.txtridge * 100 / 30) + 0.4
Case Else
Me.txtRidgetot = (Me.txtridge * 100 / 30) + 0.4
End Select

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure cboRidge_AfterUpdate..."
Resume ExitProc
End Sub


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

Hello
I currently have a combo box that is bound to a table with 2 fields and has
4 different options/records in it, with an after update procedure, that has
different calculations for each record. I want to add a Dlookup command that
will display
the record that is chosen in another text box and it will need to be placed
in the
after update procedure of the combo box also. Is this possible?

Code that is currently in the after update procedure of the combo box.

Dim prp As Property, ctl As Control

Set prp = Me!cboRidge.Properties("ListIndex")
Set ctl = Me.txtRidgetot

If prp = 0 Then
ctl = ([txtridge]*100/30)+0.4
ElseIf prp = 1 Then
ctl = ([txtridge]*100/45)+0.4
ElseIf prp = 2 Then
ctl = ([txtridge]*100/30)+0.4
Else
ctl = ([txtridge]*100/30)+0.4
End If

Set ctl = Nothing
Set prp = Nothing

Code I need to add: (2nd after update procedure)

Me.Dlookfelts.Requery


Thanks-- any help will be very appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top