Hi all,
I am building a parts ordering database for our maintenance shop and am having trouble getting my form to function the way I'd like.
I have a form that filters parts values in a listbox based on combo box values of parts classifications (ie. Electrical => Fuses returns all fuse parts).
Our Plant Manager wants to have a link to our Knowledge Base (KB) near this listbox to avoid ordering the incorrect part for a given job.
Not all parts have an entry in the KB table, so if the currently selected row of the list box has no companion in the KB I want the command button (KBLink) that runs the KB report to turn invisible.
The list box (PartSearchResults) has 3 columns:
1) The Part Number (Visible in listbox)
2) The Description of the part (Visible in listbox)
3) The KBid, if applicable (Hidden in listbox)
I am able to create a text field (HKBid) that correctly shows the value of the selected row's third column, and will update on click() of the listbox. The Control Source for this text field is =[PartSearchResults].[Column](2)
I have attempted to add this code to the Form's Current() event:
When I change the selection of PartSearchResults, I see the appropriate change to HKBid, but KBLink never appears (its default property is visible = No)Code:Private Sub Form_Current() If IsNull(PartSearchResults.Column(2)) Or PartSearchResults.Column(2) = "" Then KBLink.Visible = False Else KBLink.Visible = True End If End Sub
Does anyone have any thoughts about where I am going wrong? I'm very new to VBA and front-end development, so maybe/hopefully this is a stupid mistake that's easy to fix.
Thanks in advance for any feedback.