Re: Opening Form

Tech-Archive recommends: Speed Up your PC by fixing your registry



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,






.



Relevant Pages

  • Re: Moving data from one table to another
    ... Microsoft Office/Access MVP ... Delete Query that will empty the temp table for the next user. ... "Jeff Boyce" wrote: ...
    (microsoft.public.access.formscoding)
  • Re: Question on Iff Statement
    ... If the field allows zero-length strings, they might be 'empty', but not ... Jeff Boyce ... Microsoft Office/Access MVP ...
    (microsoft.public.access.queries)
  • Re: Select Query on Current Date
    ... We can't see your SQL statement ... Jeff Boyce ... Microsoft Office/Access MVP ... It always comes up empty. ...
    (microsoft.public.access.queries)
  • Re: Using an unbound texbox to find a record in form
    ... Microsoft Office/Access MVP ... "Jeff Boyce" wrote: ... Private Sub Command146_Click ... Dim rec As DAO.Recordset ...
    (microsoft.public.access.queries)
  • Re: Alpha key to surrogate key
    ... "Jeff Boyce" wrote: ... Microsoft Office/Access MVP ... if the customer master table is in the form. ... that a surrogate key would speed things up although, ...
    (microsoft.public.access.formscoding)