Accessing data from other forms

Dave31

Registered User.
Local time
Today, 13:57
Joined
Oct 11, 2006
Messages
68
Hi

i have a slight problem. In my tool i'm creating, i have a workproduct form and a button that takes me to another form that allows me to enter in defects to that work product (which works). The thing is, if the defect is found in a 'coded' work product, some fields will appear for new data, and other fields will disappear. On the work product form, there will be a field that displays if the work product is code or not (taken from a table) and the fields that will appear (and disappear) are on the defect form. I want the tool to look on that work product form to see if the 'phase' field is 'code', if it is, then show/hide fields on the defect form. Heres my way of interpreting what i want in code form. I hope you can gather whats going on from this:

Code:
Private Sub Form_Open(Cancel As Integer)
    If !Form.preMeetingForm2.phaseName = "Code" Then
        lineNumber.Visible = True
        lineNumber_Label.Visible True
        function2.Visible = True
        function_Label.Visible = True
        page.Visible = False
        page_Label.Visible = False
        section2.Visible = False
        section_Label.Visible = False
    End If

Note: this Form_Open event is on the defect form (where the fields will appear and disappear)

Thanks in advance :)
 
does the code not work? or sint that what your after? sorry but i dont understand what your after
 
The code doesnt work, it says compiler error (highlighting the !form. part). I was hoping the code is similar to that and im slightly out, if that is, it can be done.
Sorry, but im not sure if i can explain it better than that.
I guess a quick description is:

if a field in the workproduct form displays the words 'code' (selected from a dropdown menu), then show/hide fields in the defect form.
 
Try
If Form!preMeetingForm2!phaseName = "Code" then
 
Last edited:
Oppsssss! Me Bad......... :D
Did forget the "s"
 
lol acces sux. 1 letter and u resort to hair tearing
 

Users who are viewing this thread

Back
Top Bottom