Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changes replicating from record to record

Status
Not open for further replies.

Chris1977

Technical User
Feb 2, 2003
50
US
Here is the situation folks.

I have a section of text boxes where people can enter their hours worked from sunday to saturday, so there are obviously 7 boxes. If they take a sick day another row of text would appear based on the user clicking on an option button. The fields are on the form but their visible property is set to false........until the option button is selected then they become true.

The problem with this is if i am on a new record and unhide a row of text boxes then go to a new record that row which should be hidded automatically is visible. It is still acting as if that option button is checked on the new form even though it is not. The option buttons are unbound.

Any ideas as how to keep only one row of text boxes visible when going to a new record even if there are now 3 or 4 rows visible on a previously entered record?

Thanks folks
chris
 
It sounds like this problem will occur whenever you move to a different record.

You might try putting the code to hide the text boxes in your form's OnCurrent event.
 
Hey,

I did that and it's still doing the same thing. Here is an example of the coding for the OnCurrent and OnOpen events for the form itself:

If Me!optLine1 = True Then
Me!txtTeamID2.Visible = True
Me!txtSunHours2.Visible = True
Me!txtMonHours2.Visible = True
Me!txtTueHours2.Visible = True
Me!txtWedHours2.Visible = True
Me!txtThuHours2.Visible = True
Me!txtFriHours2.Visible = True
Me!txtSatHours2.Visible = True
Else
Me!txtTeamID2.Visible = False
Me!txtSunHours2.Visible = False
Me!txtMonHours2.Visible = False
Me!txtTueHours2.Visible = False
Me!txtWedHours2.Visible = False
Me!txtThuHours2.Visible = False
Me!txtFriHours2.Visible = False
Me!txtSatHours2.Visible = False

End If
optLine1.Value = False

OnOpen:

txtTeamID2.Visible = False
txtTeamID3.Visible = False
txtTeamID4.Visible = False
txtTeamID5.Visible = False
txtSunHours2.Visible = False
txtSunHours3.Visible = False
txtSunHours4.Visible = False
txtSunHours5.Visible = False
txtMonHours2.Visible = False
txtMonHours3.Visible = False
etc etc etc

Any help on how to have them visible on one record then visible.false as the default on all new records would be appreciated.

thanks
 
If you're using 'continuous forms' or a datasheet, I'm afraid the 'visible' property applies to all instances of a record on the form.

One thing to look out for: you may run into trouble if any of the text boxes has focus when you try to hide it.

An alternative would be to use the 'locked' or 'enabled' properties instead. Regarding visibility: locked looks normal, but you can't enter data, 'enabled' is greyed out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top