Originally posted by Rabbit
How can I autofil the City and State fields by entering a Zip?
Collapse
X
-
-
Originally posted by RabbitNot a problem, good luck.
Code:Private Sub CUSIP_NUMBER_AfterUpdate() Me.[ASSET/TR-ACCT_NUMBER] = DLookup("[ASSET]", "[ASSET/CUSIP]", "[CUSIP] = " & Me.[CUSIP_NUMBER]) End Sub
Comment
-
Originally posted by RabbitGeneral syntax of DLookup is:
Code:DLookup("[Field Name]", "[Table Name]", "Where Statement")
data type mismatch in criteria expression.
Which means I have labeled something incorrectly right?
The CusID is text because there are sometimes letters in it so as far as I know I cannot change the field to a number.Comment
-
Originally posted by RabbitCode:Private Sub CUSIP_NUMBER_AfterUpdate() Me.[ASSET/TR-ACCT_NUMBER] = DLookup("[ASSET]", "[ASSET/CUSIP]", "[CUSIP] = '" & Me.[CUSIP_NUMBER] & "'") End Sub
Microsoft Office Access can't find the field 'I' referred to in your expression.Comment
-
Originally posted by Crayola465Ok I did that and now it gives me this error;
Microsoft Office Access can't find the field 'I' referred to in your expression.Comment
-
Originally posted by RabbitI have no idea why it's doing that. As long as you are referring to everything correctly, it should work.
Let's see if any of the experts can shed a light on this.Comment
-
Originally posted by Crayola465Ok, thank you for responding. I seem to be hitting a wall here. The zip code part works great so I would think this would work just as well.
Private Sub CUSIP_NUMBER_Af terUpdate()
Me.[ASSET/TR-ACCT_NUMBER] = DLookup("[ASSET]", "[ASSET/CUSIP]", "[CUSIP] = '" & Me.[CUSIP_NUMBER] & "'")
End SubComment
-
Originally posted by Crayola465Does anyone know why this code is not working?
Private Sub CUSIP_NUMBER_Af terUpdate()
Me.[ASSET/TR-ACCT_NUMBER] = DLookup("[ASSET]", "[ASSET/CUSIP]", "[CUSIP] = '" & Me.[CUSIP_NUMBER] & "'")
End Sub
Me.[ASSET/TR-ACCT_NUMBER] = DLookup("[ASSET]", "[ASSET/CUSIP]", "[CUSIP] = " & Me.[CUSIP_NUMBER] )
2) Add:
Me.Refresh
Before the End sub to make sure the result will show.
Nic;o)Comment
-
Originally posted by nico50381) Make sure CUSIP is a text field in the table, when it's a number use:
Me.[ASSET/TR-ACCT_NUMBER] = DLookup("[ASSET]", "[ASSET/CUSIP]", "[CUSIP] = " & Me.[CUSIP_NUMBER] )
2) Add:
Me.Refresh
Before the End sub to make sure the result will show.
Nic;o)
Looking over the older posts brought something to my attention. In one post you said it was CUSID but it's CUSIP everywhere else, is everything spelled correctly?Comment
-
Originally posted by RabbitCUSIP is text.
Looking over the older posts brought something to my attention. In one post you said it was CUSID but it's CUSIP everywhere else, is everything spelled correctly?Comment
Comment