Easy Questions, hopefully!

newby2VBA

Registered User.
Local time
Today, 01:05
Joined
Feb 6, 2010
Messages
45
I have a form with a dropdown box with 5 columbs
The dropdownbox returns columb 2.
I have another field I want it to be filled with columb 5 of the same record? I was able to set the control source to =[field].Columb(5) in access 97 using a list box an it use to work, I'm drawing a blank on how to link both controls.

Question 2
My form is getting busy and I added a tab control but when I take the field control and move them to the tab they show on all tabs. Is there an easy way to make them only show on a single tab. I am reluctant to start over since there is lots of code to each field control

Thanks!:)
 
Well hello again lol.

Didn't quite understand your goal re question 1?

Answer to 2: You've got to select the page you want to paste it into, right-click on the page (or tab if you like) and paste it in there. What you selected and pasted into was the Tab Control which encompasses all pages.
 
Well hello again lol.

Didn't quite understand your goal re question 1?

Answer to 2: You've got to select the page you want to paste it into, right-click on the page (or tab if you like) and paste it in there. What you selected and pasted into was the Tab Control which encompasses all pages.

Thanks answereing Question 2 that works

Question 1
On my form I have a dropdown box for services. I need to see the service name which is "Columb 2" of my record source query. I need to see on my form if they carry inventory which is a yes/no = Columb 5
If they carry inventory I need to make my inventoryvalue field on the form required, otherwise it can be left blank.

I have a 3 controls; Services, Hasinventory, Value.

Does this make more sense?
 
Thanks answereing Question 2 that works

Question 1
On my form I have a dropdown box for services. I need to see the service name which is "Columb 2" of my record source query. I need to see on my form if they carry inventory which is a yes/no = Columb 5
If they carry inventory I need to make my inventoryvalue field on the form required, otherwise it can be left blank.

I have a 3 controls; Services, Hasinventory, Value.

Does this make more sense?

Toeleborate a little more the dropdown box I got working not an issue what can't get is the Hasinventory field to populate based on the Services field selection.
 
Code:
If Me![Services] = True Then
    ... Do something?
End If

Is this what you're referring to?
 
Code:
If Me![Services] = True Then
    ... Do something?
End If

Is this what you're referring to?


Kinda if me services = true and service has inventory then do something!
Service is a required field and in the service table each service has a yes no to has inventory.
Some services have inventory and some don't I want to do something if yes to service has inventory.
 
In the form's BeforeUpdate event:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
    If Me![Services] = True And Me![HasInventory] & "" <> "" Then
        If Me.InventoryValue.value = "" Or IsNull(Me.InventoryValue.value) Then
            Cancel = True
            MsgBox "This field cannot be left blank"
        End If
    End If
End Sub

Amend the name of the inventory control.
 
I'll try once again!
here is my table with two fields
Service Has Inventory
ABC Yes
XYZ No
If I choose ABC on my form I want to pull the yes from the table so I can do something like make value field required.
 

Users who are viewing this thread

Back
Top Bottom