combo box problem

A

Alejandro

I have while controlled by a combobox (me.fabricx), but only work if i write the number directly , here is the working code:

Private Sub des1_AfterUpdate()
Do While Me.fab = 244
intera = Me.custo - Me.custo * Me.des1 / 100
Me.inter = intera
DoCmd.GoToRecord , , acNext
Loop
DoCmd.GoToRecord , , acFirst
End Sub


but i need the code like this :


Private Sub des1_AfterUpdate()
Do While Me.fab = me.fabricx
intera = Me.custo - Me.custo * Me.des1 / 100
Me.inter = intera
DoCmd.GoToRecord , , acNext
Loop
DoCmd.GoToRecord , , acFirst
End Sub


But when i write me.fab=me.fabricx the code dont work, where is the error ????


Thanks in advance
Alejandro Carnero
 
Top