kabirpatel
Programmer
Hi,
I have a form that is bound to a row in a SQL Server table. The form contains text boxes that are used to store values for each column in my row.
The form also has an "Add New" button which, when pressed clears all the text boxes so that users can populate the text boxes with values for a new record.
To do this I have added the following to the click event of the "Add New" button
DoCmd.RunCommand acCmdDataEntry
I want to default the initial values of 2 of the textboxes. To do this I add the following code:
Me.TextBox1.text = "Blah blah blah"
When a user presses the "Add New" button the textbox1 is populated with the relevant text but it is invisible. If I switch between the form and another application it becomes visible.
To get around this I have tried using Me.Repaint but it doesn't work.
Do you have any ideas about how this can be resolved?
Thanks
Kabir
I have a form that is bound to a row in a SQL Server table. The form contains text boxes that are used to store values for each column in my row.
The form also has an "Add New" button which, when pressed clears all the text boxes so that users can populate the text boxes with values for a new record.
To do this I have added the following to the click event of the "Add New" button
DoCmd.RunCommand acCmdDataEntry
I want to default the initial values of 2 of the textboxes. To do this I add the following code:
Me.TextBox1.text = "Blah blah blah"
When a user presses the "Add New" button the textbox1 is populated with the relevant text but it is invisible. If I switch between the form and another application it becomes visible.
To get around this I have tried using Me.Repaint but it doesn't work.
Do you have any ideas about how this can be resolved?
Thanks
Kabir