Re: Opening Form
- From: "Jeff Boyce" <nonsense@xxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 15:20:53 -0700
Did you try the second approach I suggested?
Regards
Jeff Boyce
Microsoft Office/Access MVP
"Paul3rd" <Paul3rd@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:46E9F2F3-7A7A-4451-BE66-05BAB0B56621@xxxxxxxxxxxxxxxx
Thank you for your input:
When I set the "Data Entry" property of the form to "Yes"
The form does open with empty fields, however I get a code error when
I make a selection in the combo box because I have the following
code in the AfterUpdate property of that combo box:
Private Sub Combo26_AfterUpdate()
Me.RecordsetClone.FindFirst "[ID] =" & Me![Combo26]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
I also tried to set the criteria in the forms' underlying query
(the ID field) to:
[Form]![combo26]
and I placed
Me.Requery
ahead of the Me.RecordsetClone line in the
AfterUpdate property of the combo box
When I tried to open the form I got a dialog box asking for
"Combo26 parameter".
That's why I was trying to use code to make the text boxes empty.
"Jeff Boyce" wrote:
You can set a form's DataEntry property to Yes. This opens the form in
data
entry mode (no records showing).
Or, you can set the form's source to be a query that looks to the
combobox
for the recordID to display. In the AfterUpdate event of that combobox,
use
something like:
Me.Requery
This causes the form's source to be requeried, whereupon the record
matching
the one selected in the combobox is displayed!
Regards
Jeff Boyce
Microsoft Office/Access MVP
"Paul3rd" <Paul3rd@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ECC8948A-569F-421B-BDEB-019B3591A76E@xxxxxxxxxxxxxxxx
I have a form w/1 unbound combo box(combo26)
and 13 text boxes. Currently when I open the form
all of the text boxes show values from record #1.
I would like the form to have empty text box fields
until the user makes a selection in the combo26 box.
I've started working on the code as follows:
Private Sub Form_Load()
Dim indx As Integer
With Me.Controls
For indx = 0 To .Count - 1
If Me.Combo26 = Null Then
If (TypeOf Me.Controls(indx) Is TextBox) Then
Me.Controls(indx).Text = Null
ElseIf Me.Combo26 = "*" Then
Me.Controls(indx).Text = Not Null
End If
End If
Next
End With
End Sub
The code compiles OK with no error but it does nothing.
Can someome help?
Thanks in advance,
.
- Follow-Ups:
- Re: Opening Form
- From: Paul3rd
- Re: Opening Form
- References:
- Re: Opening Form
- From: Jeff Boyce
- Re: Opening Form
- From: Paul3rd
- Re: Opening Form
- Prev by Date: Re: Global variables being unset somehow!
- Next by Date: Re: auto numbering
- Previous by thread: Re: Opening Form
- Next by thread: Re: Opening Form
- Index(es):
Relevant Pages
|