annoying error 2465 wasnt happening 10 minutes ago

antonyx

Arsenal Supporter
Local time
Today, 23:05
Joined
Jan 7, 2005
Messages
556
this error is happening now and i dont know why..

it was working fine a little while ago..

i am transfering a textbox value (number) from one form to another..

here is the code that triggers the next form to open..

Code:
Private Sub txtbooker_Exit(Cancel As Integer)
If Me.txtbooker.Value = 0 Or IsNull(txtbooker) Then
DoCmd.OpenForm "frm3AddPerson", windowmode:=acDialog
If CurrentProject.AllForms("frm3AddPerson").IsLoaded Then
    Me.txtbooker = Forms!frm3AddPerson.goodid
    DoCmd.close acForm, "frm3AddPerson"
    End If
Else
Me.txtpassenger.SetFocus
End If
End Sub

so frm3AddPerson opens and the user tabs to an unbound textbox.. types in a number.. and then this should sent that number to the txtbooker control (which is the booker field in my job table)

like this..

Code:
Private Sub txtFoundID_AfterUpdate()
Dim goodid
goodid = Me.txtFoundID
Me.Visible = False
End Sub

i dont understand why it isnt working..

gettin this error 2465 application or object defined.. on this line..

Code:
Private Sub txtbooker_Exit(Cancel As Integer)
If Me.txtbooker.Value = 0 Or IsNull(txtbooker) Then
DoCmd.OpenForm "frm3AddPerson", windowmode:=acDialog
If CurrentProject.AllForms("frm3AddPerson").IsLoaded Then
    [b]Me.txtbooker = Forms!frm3AddPerson.goodid[/b]
    DoCmd.close acForm, "frm3AddPerson"
    End If
Else
Me.txtpassenger.SetFocus
End If
End Sub

im sure it was workin just now though.. i have tried creating both forms from scratch.. and it still isnt working..
i have also searched this forum and google and havent found any solution that works.
someone help
 
i have the same code pretty much word for word workin on another database..

im sure everythin is named correctly what could be causing this?
 
yes.. i have fixed it..

Code:
Me.txtbooker = Forms!frm3AddPerson.goodid

was refering to a control.. not a variable that i defined in the control..

i just named the control goodid and removed the
Code:
Dim goodid
goodid = Me.txtFoundID

and it worked.. thank god for that.. i can proceed..
 

Users who are viewing this thread

Back
Top Bottom