Updating a Current Form ( Visable fileds )

Hiten

Registered User.
Local time
Today, 12:33
Joined
Sep 17, 2001
Messages
51
Hi I have a forrm (Orders) , with a subform (Order Details)

Depending on a selection of a list field it makes certain field visible in the subform.

If I go the next record and select the list field it updates fields in the subform ( Visible ( True or False )

But if I go back to the previousl record it doesnt update the fields that are relavent to the option picked in the List Filed ( Which I have set to after update ). It works fine if I re-select the option in the list field

How do I set it to update the subform field automatically as I scroll through records?

I tried OnCurrent property but I dont think this is the correct one.

please help
 
i think you do want On Current, but then you'll have to code the visible/invisible changes based on some data in the current record. (and you won't need a list).

i think if you rely on a selection from a list, you will have to check the list for each record.

hope i understand correctly.
 
On Current

Hi Mate

Think i have not explained myself properly. Sorry my fault

I shall try again.
Orders (Form) has many Order Details (sub form)

I enter all the details on the Form ( orders )

There is a field called Size Scale Grade, depending on the grade i pick ( a to h ) certain fields in the subform become visible so I can enter the appropriate info in.

Once I have completed all the fields i go to next record. get to Size Scale Grade and no problem the correct field appear in Order Details, but if I scroll throught he records through the record selector the correct fields in the subform do not appear only the last one I entered.

So i need it to read the Size Scale Grade field everytime the record changes, not sure how to do that

Does this makes sense?
 
something like this might work:
Code:
Private Sub Form_Current()

Select Case Me.[Size Scale Grade]
    Case "a"
        Me!sfrmName!Form.fld1.visible = true
        Me!sfrmName!Form.fld2.visible = false
    Case "b"
        Me!sfrmName!Form.fld1.visible = false
        Me!sfrmName!Form.fld2.visible = true
    Case "c" To "f"
        Me!sfrmName!Form.fld1.visible = false
        Me!sfrmName!Form.fld2.visible = true
    Case Else
        Me!sfrmName!Form.fld1.visible = true
        Me!sfrmName!Form.fld2.visible = true
End Select

end sub
 
Thank You

Thank you again.

Do u know if it is possible to double click on a record in a list box, and toggle between yes and no for a certain field
 
do you mean, change the data in a field? if so, it would take a fair bit of code...
 
?

Yes. there is a list of records there and if a record is allocated i want to double click on the record and change the field ( Aloocated ) to Yes from No, or vice versa
 
- you could create an update query and run that when you want to change data.
- it might be safer to just open the appropriate form and change the data manually - three clicks.

- are these ongoing changes or one-time changes you have to make?

- did the visible/invisible part work??
 
Just one time

Hi I am developing at the mo so just one time changes

i think u r right 3 clicks easier..... it works fine that way

Thank u for all your help.

H
 
Thanks to WAZZ !!!

I myself am trying to have particular subforms show based on a choice in a list box. The ON CURRENT worked for me to solve the problem of choosing a selection, having the appropriate subform show in that record, then rolling to a new record, but getting the same subform whether it was the right one or not for that record.

THANKS!!
 
i got it to work

I got it to work on setting got focus on a filed that is the first field read on a new record, then on current making the fields visible true / false

if that makes sense
 

Users who are viewing this thread

Back
Top Bottom