Help with the code

V

Veli Izzet

Hi all,

The below code is created by access from Macro77, and it is on the
afterUpdate property of [IrsaliyeNo]. [Text27] is a text field.

The error I am getting is that the code cannot find IrsaliyeNo.

Function Macro77()


With CodeContextObject
If (Eval("[IrsaliyeNo] Is Not Null")) Then
.Nerede = .Text27 & " " & .IrsaliyeNo
End If
End With


End Function

However this below piece of code (again created by access from Macro,
Else portion added by myself) works at the same place.

Function Macro7()


With CodeContextObject
If (Not .IrsaliyeNo) Then
.Nerede = .Text27
Else
.Nerede = "Artelier Merkez"
End If
End With


End Function

I also tried to add & " " & .IrsaliyeNo to the Macro7, but it did not work.

Thanks for answers.
 
D

Dirk Goldgar

Veli Izzet said:
Hi all,

The below code is created by access from Macro77, and it is on the
afterUpdate property of [IrsaliyeNo]. [Text27] is a text field.

The error I am getting is that the code cannot find IrsaliyeNo.

Function Macro77()


With CodeContextObject
If (Eval("[IrsaliyeNo] Is Not Null")) Then
.Nerede = .Text27 & " " & .IrsaliyeNo
End If
End With


End Function

However this below piece of code (again created by access from Macro,
Else portion added by myself) works at the same place.

Function Macro7()


With CodeContextObject
If (Not .IrsaliyeNo) Then
.Nerede = .Text27
Else
.Nerede = "Artelier Merkez"
End If
End With


End Function

I also tried to add & " " & .IrsaliyeNo to the Macro7, but it did not
work.

Thanks for answers.

Code translations of macros don't always do a very good job, partly
because macros don't know in what code environment they'll be invoked.
Try this as the AfterUpdate event procedure for IrsaliyeNo, rather than
calling the function:

'----- start of event procedure code -----
Private Sub IrsaliyeNo_AfterUpdate()

If Not IsNull(Me.IrsaliyeNo) Then
Me.Nerede = Me.Text27 & " " & Me.IrsaliyeNo
End If

End Sub

'----- end of event procedure code -----
 
V

Veli Izzet

Thanks


Dirk said:
Hi all,

The below code is created by access from Macro77, and it is on the
afterUpdate property of [IrsaliyeNo]. [Text27] is a text field.

The error I am getting is that the code cannot find IrsaliyeNo.

Function Macro77()


With CodeContextObject
If (Eval("[IrsaliyeNo] Is Not Null")) Then
.Nerede = .Text27 & " " & .IrsaliyeNo
End If
End With


End Function

However this below piece of code (again created by access from Macro,
Else portion added by myself) works at the same place.

Function Macro7()


With CodeContextObject
If (Not .IrsaliyeNo) Then
.Nerede = .Text27
Else
.Nerede = "Artelier Merkez"
End If
End With


End Function

I also tried to add & " " & .IrsaliyeNo to the Macro7, but it did not
work.

Thanks for answers.


Code translations of macros don't always do a very good job, partly
because macros don't know in what code environment they'll be invoked.
Try this as the AfterUpdate event procedure for IrsaliyeNo, rather than
calling the function:

'----- start of event procedure code -----
Private Sub IrsaliyeNo_AfterUpdate()

If Not IsNull(Me.IrsaliyeNo) Then
Me.Nerede = Me.Text27 & " " & Me.IrsaliyeNo
End If

End Sub

'----- end of event procedure code -----
 
Top