Form Field will not display the string result of a drop down (1 Viewer)

atrium

Registered User.
Local time
Today, 09:24
Joined
May 13, 2014
Messages
348
I have several fields in a table that are subject to the resulting recordId that displays the string shown on the drop down. They all work as they should except one and for the life of me I can't find the reason. I have checked the property sheet for all of them and all of the properties are the same (other than the obvious) as the one that only displays the recordId not the description related to that ID

Code:
Private Sub CollStatusFld_Change()
MsgBox "The CollStatus selected is = " & Me.CollStatus
Me.CollStatusFld = DLookup("CollStatus", "CollStatus", "[CollStatusId] = " & Me.CollStatus)
End Sub

The attached files are
CollStatus001 = Properties format column
CollStatus002 = Properties Data column
CollStatus003 = Properties Event column
CollStatus004 = Properties Other column
CollStatus005 = Table Entry
CollStatus006 = Display Form
CollStatus007 =Update Form
CollStatus008 =CollStatus Table


Any suggestions would be greatly appreciated
 

Attachments

  • CollStatus001.JPG
    CollStatus001.JPG
    101 KB · Views: 60
  • CollStatus002.JPG
    CollStatus002.JPG
    29.5 KB · Views: 68
  • CollStatus003.JPG
    CollStatus003.JPG
    38.5 KB · Views: 58
  • CollStatus004.JPG
    CollStatus004.JPG
    36.4 KB · Views: 59
  • CollStatus005.JPG
    CollStatus005.JPG
    66.8 KB · Views: 62
  • CollStatus006.JPG
    CollStatus006.JPG
    29.7 KB · Views: 55
  • CollStatus007.JPG
    CollStatus007.JPG
    28.9 KB · Views: 61
  • CollStatus008.JPG
    CollStatus008.JPG
    22.3 KB · Views: 59

June7

AWF VIP
Local time
Yesterday, 15:24
Joined
Mar 9, 2014
Messages
5,474
Why don't you provide db for analysis?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 07:24
Joined
May 7, 2009
Messages
19,245
i think you have them in reversed order in your code?
Code:
Private Sub CollStatusFld_Change()
MsgBox "The CollStatus selected is = " & Me.CollStatus
Me.CollStatusFld = DLookup("CollStatus", "CollStatus", "[CollStatusId] = " & Me.CollStatus)
End Sub
should be...


Code:
Private Sub CollStatusFld_Change()
MsgBox "The CollStatus selected is = " & Val(Me.CollStatusFld.Text & "")
Me.CollStatus = DLookup("CollStatus", "CollStatus", "[CollStatusId] = " & Val(Me.CollStatusFld.Text & ""))
End Sub

Also, using Combobox for your field will make your coding easier.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:24
Joined
Feb 28, 2001
Messages
27,189
After looking at your presentations and reading your description, I don't understand your problem. We usually like to see things like this: (a) what were you trying to do in general? (b) what were you doing it with? (c) what did you actually get? (d) what would you have expected to get?

I'm not seeing the problem yet. Not denying you have one... but I don't see it. If I can't see it, I can't fix it.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 00:24
Joined
Sep 12, 2006
Messages
15,658
I looked at this again on a computer rather than phone.
I am confused between image 6 and 7. Are you trying to use a combo box, or just lookup a value?


Private Sub CollStatusFld_Change()
MsgBox "The CollStatus selected is = " & Me.CollStatus
Me.CollStatusFld = DLookup("CollStatus", "CollStatus", "[CollStatusId] = " & Me.CollStatus)
End Sub
In this code, I don't think you want to change the field in the change event FOR the same field.

In passing, I note you have also mis-spelled guarantor, although that won't affect the database.
 
Last edited:

Users who are viewing this thread

Top Bottom