473,473 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
13 1957
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
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
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
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
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
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
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
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
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
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tim Marshall | last post by:
Here's the situation. A form, frmSetUp, with a subform control called subExplain with a source object form frmSetUpSubDefineSides. The source object is a bound form, displaying a few records, no...
19
by: David W. Fenton | last post by:
I'm setting up a project for a client on a new Windows Terminal Server. The application is currently in A2K, but the sysadmin does not want to install that, he wants to install A2K3, because Office...
4
by: MS | last post by:
Just a general question here re VBA. Can anyone explain the differences between "!" and "." when refering to a control? eg Me!TxtBox and Me.TxtBox. What is difference between "+" and "&"...
3
by: Holmes | last post by:
Hello Ran into a bit of a problem here and have now exhausted my resources to getting this working What I am trying to do is load and show a simple vb form with a listbox in it Dim...
10
by: Sarah Smith | last post by:
Hello, I am a bit of a newbie to VB.NET, but not totally new. I took the plunge recently and decided (along with my colleagues), to try to convert/port a VB6 client/server app to .Net. (I'm...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
7
by: Rotsey | last post by:
Hi, I am loading a tab control on a form. The code loads textboxes and comboboxes and checkboxes, normal data entry form that loads a table row of data. I have a combo on the form above the...
7
by: PW | last post by:
Hi, I'd like to add a picture in a report where the path to the picture is from a table, depending on the dogid that is on the report (in the detail section). How can I do this? Thanks!
22
by: PW | last post by:
Hi All, I go into debug mode with the code below and varReturnVal is Null, but the code still is run. Any idea why? Dim varReturnVal As Variant Dim intDogID As Integer
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.