By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,578 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,578 IT Pros & Developers. It's quick & easy.

A2K3 form can't find a control on the form when loading!

P: n/a
PW
Hi,

This is bizarre. I've check and rechecked the spelling, cut and paste
the name of the form (when trying to rename the form) and the control
yet I still get a parameter prompt when the form runs. I've even
deleted the control and started over.

This is the code for the recordsource of the form:

"SELECT * FROM qryGuestStorePurchases_pw WHERE
purchaser=Forms!frmWalkUpPurchases_pw.cboGuests_pw ; "

I copied and pasted the name of the control:

frmWalkUpPurchases_pw

The 'Enter Parameter Value" I get when trying to run the form is for
"Forms!frmWalkUpPurchases_pw.cboGuests_pw"

I don't see any mispellings, do you?

I copied an existing form and changed the recordsource for both the
form and the combobox.

Any ideas?

By the way, the SQL syntax for the query (which runs fine), which
should not have anything to do with this, is:

SELECT qrySoldBy_pw.PurchaseID, qrySoldBy_pw.ReservationID,
qrySoldBy_pw.Date, qrySoldBy_pw.InventoryID, qrySoldBy_pw.Purchaser,
qrySoldBy_pw.Price, tblInventory.ItemNumber, tblInventory.description,
qrySoldBy_pw.Quantity, qrySoldBy_pw.Tax, qrySoldBy_pw.Name,
qrySoldBy_pw.InventoryType, qrySoldBy_pw.PurchaserType,
tblInventory.size, tblInventory.color, qrySoldBy_pw.SoldBy,
qrySoldBy_pw.SoldByName
FROM tblClients INNER JOIN (tblInventory INNER JOIN qrySoldBy_pw ON
tblInventory.InventoryID = qrySoldBy_pw.InventoryID) ON
tblClients.ClientID = qrySoldBy_pw.Purchaser
WHERE (((qrySoldBy_pw.InventoryType)="S") AND
((qrySoldBy_pw.PurchaserType)="G"))
ORDER BY qrySoldBy_pw.Date DESC;
Dec 12 '06 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Is this form named frmWalkUpPurchases_pw?

If so, you have a chicken'n'egg problem here. It has to read the value from
the control before it can load the records for the form, and it can't load
the records for the form until it has supply the values to the controls on
the form.

How about initializing the form with no records, until something is typed
into the cboGuests_pw, and then use the AfterUpdate event of the combo to
change the form's RecordSource again? In other words, save the form with
RecordSource of:
"SELECT * FROM qryGuestStorePurchases_pw WHERE (False);"

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"PW" <pa********@removewilliamsonenterprises.comwrote in message
news:6e********************************@4ax.com...
>
This is bizarre. I've check and rechecked the spelling, cut and paste
the name of the form (when trying to rename the form) and the control
yet I still get a parameter prompt when the form runs. I've even
deleted the control and started over.

This is the code for the recordsource of the form:

"SELECT * FROM qryGuestStorePurchases_pw WHERE
purchaser=Forms!frmWalkUpPurchases_pw.cboGuests_pw ; "

I copied and pasted the name of the control:

frmWalkUpPurchases_pw

The 'Enter Parameter Value" I get when trying to run the form is for
"Forms!frmWalkUpPurchases_pw.cboGuests_pw"

I don't see any mispellings, do you?

I copied an existing form and changed the recordsource for both the
form and the combobox.

Any ideas?

By the way, the SQL syntax for the query (which runs fine), which
should not have anything to do with this, is:

SELECT qrySoldBy_pw.PurchaseID, qrySoldBy_pw.ReservationID,
qrySoldBy_pw.Date, qrySoldBy_pw.InventoryID, qrySoldBy_pw.Purchaser,
qrySoldBy_pw.Price, tblInventory.ItemNumber, tblInventory.description,
qrySoldBy_pw.Quantity, qrySoldBy_pw.Tax, qrySoldBy_pw.Name,
qrySoldBy_pw.InventoryType, qrySoldBy_pw.PurchaserType,
tblInventory.size, tblInventory.color, qrySoldBy_pw.SoldBy,
qrySoldBy_pw.SoldByName
FROM tblClients INNER JOIN (tblInventory INNER JOIN qrySoldBy_pw ON
tblInventory.InventoryID = qrySoldBy_pw.InventoryID) ON
tblClients.ClientID = qrySoldBy_pw.Purchaser
WHERE (((qrySoldBy_pw.InventoryType)="S") AND
((qrySoldBy_pw.PurchaserType)="G"))
ORDER BY qrySoldBy_pw.Date DESC;

Dec 12 '06 #2

P: n/a
PW
On Tue, 12 Dec 2006 13:38:00 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>Is this form named frmWalkUpPurchases_pw?
frmWalkUpPurchases_pw

I tried to rename the form and copied and pasted the name. That's a
match, right?

>
If so, you have a chicken'n'egg problem here. It has to read the value from
the control before it can load the records for the form, and it can't load
the records for the form until it has supply the values to the controls on
the form.

How about initializing the form with no records, until something is typed
into the cboGuests_pw, and then use the AfterUpdate event of the combo to
change the form's RecordSource again? In other words, save the form with
RecordSource of:
"SELECT * FROM qryGuestStorePurchases_pw WHERE (False);"

Makes sense Allen (but how come it is working for other forms?)!

But check this out! I am now getting a brain hurting error message
when the form loads after changing the form's recordsource to your
suggestion:

"The expression onload you entered as the event property setting
produced the following error: member already exists in an object
module from which this object module derives"

eh? what is the expression onload? The form's unload event only
contains:

With Me
.txtDate_pw = DateValue(Now())
.txtDate_pw.SetFocus
End With

and this field does not have a control source.

There are two calculated fields contain in the detail section and
#Name is displayed (they do not have a control source and are based on
calculations of control source fields in the detail section)

-paul
Dec 12 '06 #3

P: n/a
The message is complaining that the OnLoad property of the form has a
problem.

If the property is set to:
[Event Procedure]
then the "member already exists" might mean that the form's modules has 2
procedures named Form_Load.

If the procedure is not duplicated, then cut the entire Form_Load procedure
from the form's module. Paste into Notepad if you wish. Save and close the
form. Compact the database.

Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact again.

Finally, open the form set its On Load property to [Event Procedure], click
the Build button (...) beside this (so Access creates the Private Sub... and
End Sub lines), and paste the rest of the routine back in.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"PW" <pa********@removewilliamsonenterprises.comwrote in message
news:34********************************@4ax.com...
On Tue, 12 Dec 2006 13:38:00 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>>Is this form named frmWalkUpPurchases_pw?

frmWalkUpPurchases_pw

I tried to rename the form and copied and pasted the name. That's a
match, right?

>>
If so, you have a chicken'n'egg problem here. It has to read the value
from
the control before it can load the records for the form, and it can't load
the records for the form until it has supply the values to the controls on
the form.

How about initializing the form with no records, until something is typed
into the cboGuests_pw, and then use the AfterUpdate event of the combo to
change the form's RecordSource again? In other words, save the form with
RecordSource of:
"SELECT * FROM qryGuestStorePurchases_pw WHERE (False);"


Makes sense Allen (but how come it is working for other forms?)!

But check this out! I am now getting a brain hurting error message
when the form loads after changing the form's recordsource to your
suggestion:

"The expression onload you entered as the event property setting
produced the following error: member already exists in an object
module from which this object module derives"

eh? what is the expression onload? The form's unload event only
contains:

With Me
.txtDate_pw = DateValue(Now())
.txtDate_pw.SetFocus
End With

and this field does not have a control source.

There are two calculated fields contain in the detail section and
#Name is displayed (they do not have a control source and are based on
calculations of control source fields in the detail section)

-paul

Dec 13 '06 #4

P: n/a
PW
On Wed, 13 Dec 2006 10:22:30 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>The message is complaining that the OnLoad property of the form has a
problem.

If the property is set to:
[Event Procedure]
then the "member already exists" might mean that the form's modules has 2
procedures named Form_Load.

If the procedure is not duplicated, then cut the entire Form_Load procedure
from the form's module. Paste into Notepad if you wish. Save and close the
form. Compact the database.

Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact again.

Finally, open the form set its On Load property to [Event Procedure], click
the Build button (...) beside this (so Access creates the Private Sub... and
End Sub lines), and paste the rest of the routine back in.
Looks like fun Allen! Learning new things. Never did a decompile
before. Yeah, there is only one Form_Load unfortuneatly (if there
wasn't then I wouldn't get to try your suggestion so that is okay :-)

I will give it a shot in a little bit. Thanks!

-paul
Dec 13 '06 #5

P: n/a
PW
On Wed, 13 Dec 2006 10:22:30 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>The message is complaining that the OnLoad property of the form has a
problem.

If the property is set to:
[Event Procedure]
then the "member already exists" might mean that the form's modules has 2
procedures named Form_Load.

If the procedure is not duplicated, then cut the entire Form_Load procedure
from the form's module. Paste into Notepad if you wish. Save and close the
form. Compact the database.

Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact again.

Finally, open the form set its On Load property to [Event Procedure], click
the Build button (...) beside this (so Access creates the Private Sub... and
End Sub lines), and paste the rest of the routine back in.
Hi Allen,

Same error message. It happens in the Load and Unload procedures. If
I remove one or the other then I don't get the error message during
that event. Here is the code for both:

Private Sub Form_Load()

On Error GoTo ErrorTag_pw

With Me
.txtDate_pw = DateValue(Now())
.txtDate_pw.SetFocus
End With

Exit Sub

ErrorTag_pw:
MsgBox "Error #" & Err.number & ": " & Err.description

End Sub

Private Sub Form_Unload(Cancel As Integer)

If Not IsNull(Me.txtDate_pw) And Not IsNull(Me.cboGuest_pw) And Not
IsNull(Me.cboItemNo_pw) And Not IsNull(Me.txtQuantity_pw) Then

Dim varResponse_pw As Variant

strMsg_pw = "Do you want to save this transaction?"
strTitle_pw = "Record not saved."
intButtons_pw = VbYESNO

varResponse_pw = MsgBox(strMsg_pw, intButtons_pw, strTitle_pw)

If varResponse_pw = VbYES Then

EditForm_pw

If blnPassedEdits_pw Then
SaveRecord_pw
ClearFields_pw
Else
DoCmd.CancelEvent
End If

End If

End If

And, although the form does load (and unload) after responding to the
error message there are four calculated fields on the form that end up
displaying #NAME. Two have control sources (in the detail section)
and two do not (in the header section). Funny, I tried your
suggestion with the "Select ....... Where (Name)" in the form that I
"cloned" (save as-ed) this one from and I do not get the #NAME errors
in those text boxes.

txtSubTotal_pw =[txtPrice_pw]*[txtQuantity_pw]
txtTotal_pw =[txtSubTotal_pw]+[txtTax_pw]

I think maybe I have start this form over from scratch!

-paul
Dec 13 '06 #6

P: n/a
Okay, looking at the content of your procedure, what is txtDate_pw?
Is it the name of a text box?
Is it bound to a field?
Is the form bound at all?

If bound, why are you trying to assign a value to whatever record happens to
be the first one when the form opens (however it happens to be filtered or
sorted)? Does it make any sense to change that records just because you
loaded the form?

The same comment applies to the Unload event. That's too late to change the
value in a bound control.

If you are trying to store a total (not recommended), use the AfterUpdate
event of the controls it depends on. Details in:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

If that's not what you are doing, I'm not clear what you need to achieve.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"PW" <pa********@removewilliamsonenterprises.comwrote in message
news:u2********************************@4ax.com...
On Wed, 13 Dec 2006 10:22:30 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>>The message is complaining that the OnLoad property of the form has a
problem.

If the property is set to:
[Event Procedure]
then the "member already exists" might mean that the form's modules has 2
procedures named Form_Load.

If the procedure is not duplicated, then cut the entire Form_Load
procedure
from the form's module. Paste into Notepad if you wish. Save and close the
form. Compact the database.

Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and
include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact again.

Finally, open the form set its On Load property to [Event Procedure],
click
the Build button (...) beside this (so Access creates the Private Sub...
and
End Sub lines), and paste the rest of the routine back in.

Hi Allen,

Same error message. It happens in the Load and Unload procedures. If
I remove one or the other then I don't get the error message during
that event. Here is the code for both:

Private Sub Form_Load()

On Error GoTo ErrorTag_pw

With Me
.txtDate_pw = DateValue(Now())
.txtDate_pw.SetFocus
End With

Exit Sub

ErrorTag_pw:
MsgBox "Error #" & Err.number & ": " & Err.description

End Sub

Private Sub Form_Unload(Cancel As Integer)

If Not IsNull(Me.txtDate_pw) And Not IsNull(Me.cboGuest_pw) And Not
IsNull(Me.cboItemNo_pw) And Not IsNull(Me.txtQuantity_pw) Then

Dim varResponse_pw As Variant

strMsg_pw = "Do you want to save this transaction?"
strTitle_pw = "Record not saved."
intButtons_pw = VbYESNO

varResponse_pw = MsgBox(strMsg_pw, intButtons_pw, strTitle_pw)

If varResponse_pw = VbYES Then

EditForm_pw

If blnPassedEdits_pw Then
SaveRecord_pw
ClearFields_pw
Else
DoCmd.CancelEvent
End If

End If

End If

And, although the form does load (and unload) after responding to the
error message there are four calculated fields on the form that end up
displaying #NAME. Two have control sources (in the detail section)
and two do not (in the header section). Funny, I tried your
suggestion with the "Select ....... Where (Name)" in the form that I
"cloned" (save as-ed) this one from and I do not get the #NAME errors
in those text boxes.

txtSubTotal_pw =[txtPrice_pw]*[txtQuantity_pw]
txtTotal_pw =[txtSubTotal_pw]+[txtTax_pw]

I think maybe I have start this form over from scratch!

-paul

Dec 13 '06 #7

P: n/a
PW
On Wed, 13 Dec 2006 14:06:30 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>Okay, looking at the content of your procedure, what is txtDate_pw?
An unbound text box in the header section (add my initials to the end
of things so as I know if my wife screwed something up! :-) Husband
and wife team, can you believe we're still married after 14 years of
this? LOL!).
>Is it the name of a text box?
Yes
>Is it bound to a field?
No
>Is the form bound at all?
Do you mean the recordsource? If so, it's:

SELECT * FROM qryGuestStorePurchases_pw WHERE (False);

>
If bound, why are you trying to assign a value to whatever record happens to
be the first one when the form opens (however it happens to be filtered or
sorted)? Does it make any sense to change that records just because you
loaded the form?
N/A. I am just setting the unbound date textbox to today's date.

Here is how the forms operate: In the header section there are
unbound fields, including a dropdown box where after the user selects
a guest the bound controls in the detail section shows their store
purchases. To enter a new purchase (after selecting the guest) the
user fills in the unbound text boxes, comboboxes in the the header
section and the record is saved (manually by my code) and the form is
requeried (me.requery) to update the detail section. If the user
wants to edit/delete a purchase/row he/she clicks on a row and presses
an edit/delete button, etc, etc...
>
The same comment applies to the Unload event. That's too late to change the
value in a bound control.
I should not run the clearfields routine if exiting the form, you are
correct! But, I am not changing any values of a bound control any way
in the unload event:

Private Sub Form_Unload(Cancel As Integer)

If Not IsNull(Me.txtDate_pw) And Not IsNull(Me.cboGuest_pw) And Not
IsNull(Me.cboItemNo_pw) And Not IsNull(Me.txtQuantity_pw) Then

Dim varResponse_pw As Variant

strMsg_pw = "Do you want to save this transaction?"
strTitle_pw = "Record not saved."
intButtons_pw = VbYESNO

varResponse_pw = MsgBox(strMsg_pw, intButtons_pw, strTitle_pw)

If varResponse_pw = VbYES Then

EditForm_pw

If blnPassedEdits_pw Then
SaveRecord_pw
' ClearFields_pw ' Don't need to do
this in the unload event!
Else
DoCmd.CancelEvent
End If

End If

End If

End Sub
>
If you are trying to store a total (not recommended), use the AfterUpdate
event of the controls it depends on. Details in:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

If that's not what you are doing, I'm not clear what you need to achieve.
I simply have the control source of the unbound fields in the header
section set to a calculation. Same for the bound fields as the user
can not enter any data in the detail section (and the AfterUpdate
wouldn't get fired, right?).

Thanks Allen,

-paul
Dec 13 '06 #8

P: n/a
If the text box is unbound, then assign it a value in Form_Load should not
be a problem. I'm not sure what's causing the hiccup.

The RecordSource of the form no longer refers to the text box, so that
should not be a factor.

I wonder if Access is confused about the name of something? If you have not
already done so, you might uncheck the Name AutoCorrect boxes under:
Tools | Options | General
and compact again. Explanation of some of the problems this causes:
http://allenbrowne.com/bug-03.html

The DateValue() is not needed.
Try commenting out the SetFocus temporarily.

Are you now getting a compile error? Or a runtime error?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"PW" <pa********@removewilliamsonenterprises.comwrote in message
news:tl********************************@4ax.com...
On Wed, 13 Dec 2006 14:06:30 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>>Okay, looking at the content of your procedure, what is txtDate_pw?

An unbound text box in the header section (add my initials to the end
of things so as I know if my wife screwed something up! :-) Husband
and wife team, can you believe we're still married after 14 years of
this? LOL!).
>>Is it the name of a text box?

Yes
>>Is it bound to a field?

No
>>Is the form bound at all?

Do you mean the recordsource? If so, it's:

SELECT * FROM qryGuestStorePurchases_pw WHERE (False);

>>
If bound, why are you trying to assign a value to whatever record happens
to
be the first one when the form opens (however it happens to be filtered or
sorted)? Does it make any sense to change that records just because you
loaded the form?

N/A. I am just setting the unbound date textbox to today's date.

Here is how the forms operate: In the header section there are
unbound fields, including a dropdown box where after the user selects
a guest the bound controls in the detail section shows their store
purchases. To enter a new purchase (after selecting the guest) the
user fills in the unbound text boxes, comboboxes in the the header
section and the record is saved (manually by my code) and the form is
requeried (me.requery) to update the detail section. If the user
wants to edit/delete a purchase/row he/she clicks on a row and presses
an edit/delete button, etc, etc...
>>
The same comment applies to the Unload event. That's too late to change
the
value in a bound control.

I should not run the clearfields routine if exiting the form, you are
correct! But, I am not changing any values of a bound control any way
in the unload event:

Private Sub Form_Unload(Cancel As Integer)

If Not IsNull(Me.txtDate_pw) And Not IsNull(Me.cboGuest_pw) And Not
IsNull(Me.cboItemNo_pw) And Not IsNull(Me.txtQuantity_pw) Then

Dim varResponse_pw As Variant

strMsg_pw = "Do you want to save this transaction?"
strTitle_pw = "Record not saved."
intButtons_pw = VbYESNO

varResponse_pw = MsgBox(strMsg_pw, intButtons_pw, strTitle_pw)

If varResponse_pw = VbYES Then

EditForm_pw

If blnPassedEdits_pw Then
SaveRecord_pw
' ClearFields_pw ' Don't need to do
this in the unload event!
Else
DoCmd.CancelEvent
End If

End If

End If

End Sub
>>
If you are trying to store a total (not recommended), use the AfterUpdate
event of the controls it depends on. Details in:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

If that's not what you are doing, I'm not clear what you need to achieve.

I simply have the control source of the unbound fields in the header
section set to a calculation. Same for the bound fields as the user
can not enter any data in the detail section (and the AfterUpdate
wouldn't get fired, right?).

Thanks Allen,

-paul

Dec 13 '06 #9

P: n/a
PW
On Wed, 13 Dec 2006 15:02:20 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>If the text box is unbound, then assign it a value in Form_Load should not
be a problem. I'm not sure what's causing the hiccup.

The RecordSource of the form no longer refers to the text box, so that
should not be a factor.

I wonder if Access is confused about the name of something?
I think it's confused for sure! But the following did not help:
If you have not
already done so, you might uncheck the Name AutoCorrect boxes under:
Tools | Options | General
and compact again. Explanation of some of the problems this causes:
http://allenbrowne.com/bug-03.html

The DateValue() is not needed.
Try commenting out the SetFocus temporarily.
The Form_Load is now (I commented everything out but still get that
error! But If I delete the Form_Load declaration entirely it works
(except for the #name stuff)!!!!!):

Private Sub Form_Load()

'On Error GoTo ErrorTag_pw

'With Me
' .txtDate_pw = DateValue(Now())
' .txtDate_pw.SetFocus
'End With

'Exit Sub

'ErrorTag_pw:
' MsgBox "Error #" & Err.number & ": " & Err.description

End Sub
>Are you now getting a compile error? Or a runtime error?
Neither (do you mean when I press the save button in the Visual Basic
code view?).

Is this not strange? I searched for "Load" in the VB code window and
found nothing! I think I have to start over from scratch with this
form and take it one step at a time! Perhaps even starting with a new
MDB!

Thanks again Allen!

-paul

Dec 13 '06 #10

P: n/a
By "compile error", I mean: What happens when you choose Compile on the
Debug menu (from the code window)? Does it compile and save silently (and
the Compile menu item greys out to indicate success?) Or does it generate a
syntax error?

By "runtime error", I mean that when you go to open the form, Access shows a
dialog with an error message.

There are some options to try before a rebuild-from scratch. You could try
the undocumented SaveAsText, delete the form, and then LoadFromText. Example
SaveAsText acForm, "Form1", "C:\Form1.txt"

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"PW" <pa********@removewilliamsonenterprises.comwrote in message
news:jn********************************@4ax.com...
On Wed, 13 Dec 2006 15:02:20 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>>If the text box is unbound, then assign it a value in Form_Load should not
be a problem. I'm not sure what's causing the hiccup.

The RecordSource of the form no longer refers to the text box, so that
should not be a factor.

I wonder if Access is confused about the name of something?

I think it's confused for sure! But the following did not help:
>If you have not
already done so, you might uncheck the Name AutoCorrect boxes under:
Tools | Options | General
and compact again. Explanation of some of the problems this causes:
http://allenbrowne.com/bug-03.html

The DateValue() is not needed.
Try commenting out the SetFocus temporarily.

The Form_Load is now (I commented everything out but still get that
error! But If I delete the Form_Load declaration entirely it works
(except for the #name stuff)!!!!!):

Private Sub Form_Load()

'On Error GoTo ErrorTag_pw

'With Me
' .txtDate_pw = DateValue(Now())
' .txtDate_pw.SetFocus
'End With

'Exit Sub

'ErrorTag_pw:
' MsgBox "Error #" & Err.number & ": " & Err.description

End Sub
>>Are you now getting a compile error? Or a runtime error?

Neither (do you mean when I press the save button in the Visual Basic
code view?).

Is this not strange? I searched for "Load" in the VB code window and
found nothing! I think I have to start over from scratch with this
form and take it one step at a time! Perhaps even starting with a new
MDB!

Thanks again Allen!

-paul

Dec 13 '06 #11

P: n/a
PW
On Wed, 13 Dec 2006 15:34:11 +0900, "Allen Browne"
<Al*********@SeeSig.invalidwrote:
>By "compile error", I mean: What happens when you choose Compile on the
Debug menu (from the code window)? Does it compile and save silently (and
the Compile menu item greys out to indicate success?) Or does it generate a
syntax error?
I forgot to do that today (a bit under the weather).

****BINGO****

I have no idea how it happened but there were two procedures with
events not attached to anything!

There was a Private Sub GotFocus() and also a Private Sub
AfterUpdate() !!! I commented both those out and now the form loads
and I don't get the #NAME either! I also added back the original
RecordSource for the form (with the reference to the combobox control
filter) and it works too!

I swear to whatever that I did not have anything to do with that! How
would something like that happen?

Access/Jet needs error messages that makes more sense! I don't
remember ever getting clueless ones like these in Visual FoxPro!

Thanks Allen!

OT But now, what do you know about exporting Access 2003 data to
Quickbooks? We need to get that done. (I'll e-mail you using your
website address if you have any ideas).

Midnight bell just went off here in Montana USA. Thanks again for
your persistance and excellance!

-paul

>
By "runtime error", I mean that when you go to open the form, Access shows a
dialog with an error message.

There are some options to try before a rebuild-from scratch. You could try
the undocumented SaveAsText, delete the form, and then LoadFromText. Example
SaveAsText acForm, "Form1", "C:\Form1.txt"
Dec 13 '06 #12

P: n/a
"Allen Browne" <Al*********@SeeSig.invalidwrote in
news:45**********************@per-qv1-newsreader-01.iinet.net.au:
If the text box is unbound, then assign it a value in Form_Load
should not be a problem. I'm not sure what's causing the hiccup.
If it's the same value every time you load the form, then it ought
to be the Default Value of the textbox, instead. You only need code
to assign the value OnLoad if you're calculating what it should be
at runtime.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 13 '06 #13

P: n/a
PW
On Wed, 13 Dec 2006 12:27:05 -0600, "David W. Fenton"
<XX*******@dfenton.com.invalidwrote:
>"Allen Browne" <Al*********@SeeSig.invalidwrote in
news:45**********************@per-qv1-newsreader-01.iinet.net.au:
>If the text box is unbound, then assign it a value in Form_Load
should not be a problem. I'm not sure what's causing the hiccup.

If it's the same value every time you load the form, then it ought
to be the Default Value of the textbox, instead. You only need code
to assign the value OnLoad if you're calculating what it should be
at runtime.

Thanks David. I will ponder that.

-paul
Dec 13 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.