|
 |
access thread: Ghosts
Message #1 by "Charlie Goodwin" <cgoodwin@c...> on Fri, 20 Dec 2002 01:34:33 -0500
|
|
I have been converting continuous subforms in a DB into unbound listboxes w
ith adjacent buttons to summon up forms that will add a new transaction det
ail item, edit the item or remove the item.
If no item has been selected in the listbox and the edit or delete is click
ed, then a messagebox warns the user to make a selection. All is fine so
far.
If I do select and delete the item, which really just sets it's value to $0
, the item disappears from the listbox just as it should, since queries / S
QL in the listbox, (and pretty much everything else in the DB) are set to e
liminate $0 values.
The oddity is that if I then click on edit or delete buttons, when the list
has nothing currently selected, but did since the form was opened, I do n
ot get warning messageboxes, but instead the edit or delete forms are summo
ned up.
Somehow, the listboxes are appearing to retain the "ghost" of the value the
y last had, which would be the detail item selected previously. Since not
hing is selected, I would guess the listbox should be null. On the edit a
nd delete buttons I have code like this:
If IsNull([Form]![TransactionFormName]![ListName]) Then
MsgBox "Warning text "
Else
DoCmd.OpenForm "EditOrDeleteFormName"
End If
Other than this odd behaviour, they're working fine.
Any ideas?
Charlie
Message #2 by "Haslett, Andrew" <andrew.haslett@i...> on Fri, 20 Dec 2002 19:39:21 +1030
|
|
I've had this same problem. It seems to 'remember' that an item was
previously selected.
I'll go back and check the code, but I don't recall finding an answer. Let
me know if you do!!
Cheers,
A
-----Original Message-----
From: Charlie Goodwin [mailto:cgoodwin@c...]
Sent: Friday, 20 December 2002 5:05 PM
To: Access
Subject: [access] Ghosts
I have been converting continuous subforms in a DB into unbound listboxes
with adjacent buttons to summon up forms that will add a new transaction
detail item, edit the item or remove the item.
If no item has been selected in the listbox and the edit or delete is
clicked, then a messagebox warns the user to make a selection. All is fine
so far.
If I do select and delete the item, which really just sets it's value to $0,
the item disappears from the listbox just as it should, since queries / SQL
in the listbox, (and pretty much everything else in the DB) are set to
eliminate $0 values.
The oddity is that if I then click on edit or delete buttons, when the list
has nothing currently selected, but did since the form was opened, I do not
get warning messageboxes, but instead the edit or delete forms are summoned
up.
Somehow, the listboxes are appearing to retain the "ghost" of the value they
last had, which would be the detail item selected previously. Since
nothing is selected, I would guess the listbox should be null. On the edit
and delete buttons I have code like this:
If IsNull([Form]![TransactionFormName]![ListName]) Then
MsgBox "Warning text "
Else
DoCmd.OpenForm "EditOrDeleteFormName"
End If
Other than this odd behaviour, they're working fine.
Any ideas?
Charlie
IMPORTANT - PLEASE READ ********************
This email and any files transmitted with it are confidential and may
contain information protected by law from disclosure.
If you have received this message in error, please notify the sender
immediately and delete this email from your system.
No warranty is given that this email or files, if attached to this
email, are free from computer viruses or other defects. They
are provided on the basis the user assumes all responsibility for
loss, damage or consequence resulting directly or indirectly from
their use, whether caused by the negligence of the sender or not.
Message #3 by "Carnley, Dave" <dcarnley@a...> on Fri, 20 Dec 2002 09:31:44 -0600
|
|
if a field has enver had a value it is null, but if it had a value and then
you deleted that value, the field value is "". Which is a heck of a lot
like NULL but it isn't exactly NULL.
(I hope this is correct and not a VB/VBA difference...)
-----Original Message-----
From: Haslett, Andrew [mailto:andrew.haslett@i...]
Sent: Friday, December 20, 2002 3:09 AM
To: Access
Subject: [access] RE: Ghosts
I've had this same problem. It seems to 'remember' that an item was
previously selected.
I'll go back and check the code, but I don't recall finding an answer. Let
me know if you do!!
Cheers,
A
-----Original Message-----
From: Charlie Goodwin [mailto:cgoodwin@c...]
Sent: Friday, 20 December 2002 5:05 PM
To: Access
Subject: [access] Ghosts
I have been converting continuous subforms in a DB into unbound listboxes
with adjacent buttons to summon up forms that will add a new transaction
detail item, edit the item or remove the item.
If no item has been selected in the listbox and the edit or delete is
clicked, then a messagebox warns the user to make a selection. All is fine
so far.
If I do select and delete the item, which really just sets it's value to $0,
the item disappears from the listbox just as it should, since queries / SQL
in the listbox, (and pretty much everything else in the DB) are set to
eliminate $0 values.
The oddity is that if I then click on edit or delete buttons, when the list
has nothing currently selected, but did since the form was opened, I do not
get warning messageboxes, but instead the edit or delete forms are summoned
up.
Somehow, the listboxes are appearing to retain the "ghost" of the value they
last had, which would be the detail item selected previously. Since
nothing is selected, I would guess the listbox should be null. On the edit
and delete buttons I have code like this:
If IsNull([Form]![TransactionFormName]![ListName]) Then
MsgBox "Warning text "
Else
DoCmd.OpenForm "EditOrDeleteFormName"
End If
Other than this odd behaviour, they're working fine.
Any ideas?
Charlie
IMPORTANT - PLEASE READ ********************
This email and any files transmitted with it are confidential and may
contain information protected by law from disclosure.
If you have received this message in error, please notify the sender
immediately and delete this email from your system.
No warranty is given that this email or files, if attached to this
email, are free from computer viruses or other defects. They
are provided on the basis the user assumes all responsibility for
loss, damage or consequence resulting directly or indirectly from
their use, whether caused by the negligence of the sender or not.
Message #4 by "Charlie Goodwin" <cgoodwin@c...> on Fri, 20 Dec 2002 11:46:30 -0500
|
|
The plot thickens.
My listbox seems to be retaining the last selected value, even if that valu
e is "impossible".
To diagnose, I created a text box with the control source: =3D[LstCostItem
] LstCostItem is a misbehaving listbox.
If I select a detail, say detail 500 from, transaction 100. the box dutif
ully displays 500.
And then I move to main transaction record 101, without selecting a new de
tail item at all, the display in the listbox changes, but the textbox keeps
showing 500 till I actually select a new detail. Once I make a new selec
tion, then everything works untill I move to a new record or remove the pre
viously selected item without selecting something further.
I have tried refreshing the form... adding other code to look for "" I su
spect that is'nt the problem. I seem to have to make a new selection or c
lose the form to exorcise the ghost of the previous selection....
Is my textbox telling me the truth about my errant listbox? Does this new
view of the problem help anyone help me?
Charlie
> if a field has enver had a value it is null, but if it had a value and th
en
> you deleted that value, the field value is "". Which is a heck of a lot
> like NULL but it isn't exactly NULL.
>
> (I hope this is correct and not a VB/VBA difference...)
>
> -----Original Message-----
> From: Haslett, Andrew [mailto:andrew.haslett@i...]
> Sent: Friday, December 20, 2002 3:09 AM
> To: Access
> Subject: [access] RE: Ghosts
>
>
> I've had this same problem. It seems to 'remember' that an item was
> previously selected.
>
> I'll go back and check the code, but I don't recall finding an answer. Let
> me know if you do!!
>
> Cheers,
> A
>
> -----Original Message-----
> From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
net.com]]
> Sent: Friday, 20 December 2002 5:05 PM
> To: Access
> Subject: [access] Ghosts
>
>
> I have been converting continuous subforms in a DB into unbound listboxes
> with adjacent buttons to summon up forms that will add a new transaction
> detail item, edit the item or remove the item.
>
> If no item has been selected in the listbox and the edit or delete is
> clicked, then a messagebox warns the user to make a selection. All is f
ine
> so far.
>
> If I do select and delete the item, which really just sets it's value to
$0,
> the item disappears from the listbox just as it should, since queries / S
QL
> in the listbox, (and pretty much everything else in the DB) are set to
> eliminate $0 values.
>
> The oddity is that if I then click on edit or delete buttons, when the li
st
> has nothing currently selected, but did since the form was opened, I do
not
> get warning messageboxes, but instead the edit or delete forms are summon
ed
> up.
>
> Somehow, the listboxes are appearing to retain the "ghost" of the value t
hey
> last had, which would be the detail item selected previously. Since
> nothing is selected, I would guess the listbox should be null. On the e
dit
> and delete buttons I have code like this:
>
> If IsNull([Form]![TransactionFormName]![ListName]) Then
> MsgBox "Warning text "
> Else
> DoCmd.OpenForm "EditOrDeleteFormName"
> End If
>
> Other than this odd behaviour, they're working fine.
>
> Any ideas?
>
> Charlie
>
>
> IMPORTANT - PLEASE READ ********************
> This email and any files transmitted with it are confidential and may
> contain information protected by law from disclosure.
> If you have received this message in error, please notify the sender
> immediately and delete this email from your system.
> No warranty is given that this email or files, if attached to this
> email, are free from computer viruses or other defects. They
> are provided on the basis the user assumes all responsibility for
> loss, damage or consequence resulting directly or indirectly from
> their use, whether caused by the negligence of the sender or not.
>
>
Message #5 by "John Ruff" <papparuff@a...> on Fri, 20 Dec 2002 11:47:48 -0800
|
|
Try this,
Add the following line of code to your Edit/Delete buttons
' Requeries the ListCostItem listbox to the new values
ListCostItem.Requery
John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities
www.noclassroom.com
Live software training
Right over the Internet
Home: xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498
"Commit to the Lord whatever you do,
and your plans will succeed." Proverbs 16:3
-----Original Message-----
From: Charlie Goodwin [mailto:cgoodwin@c...]
Sent: Friday, December 20, 2002 8:47 AM
To: Access
Subject: [access] RE: Ghosts
The plot thickens.
My listbox seems to be retaining the last selected value, even if that
value
is "impossible".
To diagnose, I created a text box with the control source:
=3D[LstCostItem]
LstCostItem is a misbehaving listbox.
If I select a detail, say detail 500 from, transaction 100. the box
dutifully displays 500.
And then I move to main transaction record 101, without selecting a new
detail item at all, the display in the listbox changes, but the textbox
keeps showing 500 till I actually select a new detail. Once I make a
new
selection, then everything works untill I move to a new record or remove
the
previously selected item without selecting something further.
I have tried refreshing the form... adding other code to look for "" I
suspect that is'nt the problem. I seem to have to make a new selection
or
close the form to exorcise the ghost of the previous selection....
Is my textbox telling me the truth about my errant listbox? Does this
new
view of the problem help anyone help me?
Charlie
> if a field has enver had a value it is null, but if it had a value and
> then you deleted that value, the field value is "". Which is a heck
> of a lot like NULL but it isn't exactly NULL.
>
> (I hope this is correct and not a VB/VBA difference...)
>
> -----Original Message-----
> From: Haslett, Andrew [mailto:andrew.haslett@i...]
> Sent: Friday, December 20, 2002 3:09 AM
> To: Access
> Subject: [access] RE: Ghosts
>
>
> I've had this same problem. It seems to 'remember' that an item was
> previously selected.
>
> I'll go back and check the code, but I don't recall finding an answer.
> Let me know if you do!!
>
> Cheers,
> A
>
> -----Original Message-----
> From: Charlie Goodwin [mailto:cgoodwin@c...]
> [mailto:cgoodwin@c...]]
> Sent: Friday, 20 December 2002 5:05 PM
> To: Access
> Subject: [access] Ghosts
>
>
> I have been converting continuous subforms in a DB into unbound
> listboxes with adjacent buttons to summon up forms that will add a new
> transaction detail item, edit the item or remove the item.
>
> If no item has been selected in the listbox and the edit or delete is
> clicked, then a messagebox warns the user to make a selection. All
is
fine
> so far.
>
> If I do select and delete the item, which really just sets it's value
> to $0, the item disappears from the listbox just as it should, since
> queries / SQL in the listbox, (and pretty much everything else in the
> DB) are set to eliminate $0 values.
>
> The oddity is that if I then click on edit or delete buttons, when the
> list has nothing currently selected, but did since the form was
> opened, I do not get warning messageboxes, but instead the edit or
> delete forms are summoned up.
>
> Somehow, the listboxes are appearing to retain the "ghost" of the
value
they
> last had, which would be the detail item selected previously. Since
> nothing is selected, I would guess the listbox should be null. On
the
edit
> and delete buttons I have code like this:
>
> If IsNull([Form]![TransactionFormName]![ListName]) Then MsgBox
> "Warning text " Else
> DoCmd.OpenForm "EditOrDeleteFormName"
> End If
>
> Other than this odd behaviour, they're working fine.
>
> Any ideas?
>
> Charlie
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
>
> IMPORTANT - PLEASE READ ********************
> This email and any files transmitted with it are confidential and may
> contain information protected by law from disclosure. If you have
> received this message in error, please notify the sender immediately
> and delete this email from your system. No warranty is given that this
> email or files, if attached to this email, are free from computer
> viruses or other defects. They are provided on the basis the user
> assumes all responsibility for loss, damage or consequence resulting
> directly or indirectly from their use, whether caused by the
> negligence of the sender or not.
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to
> unsubscribe send a blank email to
Message #6 by "Charlie Goodwin" <cgoodwin@c...> on Sat, 21 Dec 2002 01:17:27 -0500
|
|
MyControlName.Requery ........ didn't work, but I may have dug up an
answer:
If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
MsgBox "Warning BlahBlah"
Else
DoCmd.OpenForm "MyFormName"
End If
It stops the process so forms don't come up to edit a non existant record.
Charlie
> Try this,
>
> Add the following line of code to your Edit/Delete buttons
>
> ' Requeries the ListCostItem listbox to the new values
> ListCostItem.Requery
>
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
>
> www.noclassroom.com
> Live software training
> Right over the Internet
>
> Home: xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
>
> "Commit to the Lord whatever you do,
> and your plans will succeed." Proverbs 16:3
>
>
>
> -----Original Message-----
> From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
net.com]]
> Sent: Friday, December 20, 2002 8:47 AM
> To: Access
> Subject: [access] RE: Ghosts
>
>
> The plot thickens.
>
> My listbox seems to be retaining the last selected value, even if that va
lue
> is "impossible".
>
> To diagnose, I created a text box with the control source: =3D[LstCostIt
em]
> LstCostItem is a misbehaving listbox.
>
> If I select a detail, say detail 500 from, transaction 100. the box
> dutifully displays 500.
>
> And then I move to main transaction record 101, without selecting a new
> detail item at all, the display in the listbox changes, but the textbox
> keeps showing 500 till I actually select a new detail. Once I make a new
> selection, then everything works untill I move to a new record or remove
the
> previously selected item without selecting something further.
>
> I have tried refreshing the form... adding other code to look for "" I
> suspect that is'nt the problem. I seem to have to make a new selection
or
> close the form to exorcise the ghost of the previous selection....
>
> Is my textbox telling me the truth about my errant listbox? Does this n
ew
> view of the problem help anyone help me?
>
> Charlie
>
>
>
>
>
>
>
> > if a field has enver had a value it is null, but if it had a value and
> > then you deleted that value, the field value is "". Which is a heck
> > of a lot like NULL but it isn't exactly NULL.
> >
> > (I hope this is correct and not a VB/VBA difference...)
> >
> > -----Original Message-----
> > From: Haslett, Andrew [mailto:andrew.haslett@i...]
> > Sent: Friday, December 20, 2002 3:09 AM
> > To: Access
> > Subject: [access] RE: Ghosts
> >
> >
> > I've had this same problem. It seems to 'remember' that an item was
> > previously selected.
> >
> > I'll go back and check the code, but I don't recall finding an answer.
> > Let me know if you do!!
> >
> > Cheers,
> > A
> >
> > -----Original Message-----
> > From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
nknet.com]]
> > [mailto:cgoodwin@c...]] [mailto:cgoodwin@c...]]]
> > Sent: Friday, 20 December 2002 5:05 PM
> > To: Access
> > Subject: [access] Ghosts
> >
> >
> > I have been converting continuous subforms in a DB into unbound
> > listboxes with adjacent buttons to summon up forms that will add a new
> > transaction detail item, edit the item or remove the item.
> >
> > If no item has been selected in the listbox and the edit or delete is
> > clicked, then a messagebox warns the user to make a selection. All is
> fine
> > so far.
> >
> > If I do select and delete the item, which really just sets it's value
> > to $0, the item disappears from the listbox just as it should, since
> > queries / SQL in the listbox, (and pretty much everything else in the
> > DB) are set to eliminate $0 values.
> >
> > The oddity is that if I then click on edit or delete buttons, when the
> > list has nothing currently selected, but did since the form was
> > opened, I do not get warning messageboxes, but instead the edit or
> > delete forms are summoned up.
> >
> > Somehow, the listboxes are appearing to retain the "ghost" of the value
> they
> > last had, which would be the detail item selected previously. Since
> > nothing is selected, I would guess the listbox should be null. On the
> edit
> > and delete buttons I have code like this:
> >
> > If IsNull([Form]![TransactionFormName]![ListName]) Then MsgBox
> > "Warning text " Else
> > DoCmd.OpenForm "EditOrDeleteFormName"
> > End If
> >
> > Other than this odd behaviour, they're working fine.
> >
> > Any ideas?
> >
> > Charlie
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to
> > unsubscribe send a blank email to
> >
> > IMPORTANT - PLEASE READ ********************
> > This email and any files transmitted with it are confidential and may
> > contain information protected by law from disclosure. If you have
> > received this message in error, please notify the sender immediately
> > and delete this email from your system. No warranty is given that this
> > email or files, if attached to this email, are free from computer
> > viruses or other defects. They are provided on the basis the user
> > assumes all responsibility for loss, damage or consequence resulting
> > directly or indirectly from their use, whether caused by the
> > negligence of the sender or not.
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to
> > unsubscribe send a blank email to
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to
> > unsubscribe send a blank email to
>
>
>
>
Message #7 by "Charlie Goodwin" <cgoodwin@c...> on Sat, 21 Dec 2002 01:22:34 -0500
|
|
Sorry, I forgot to append older portions of this thread...
MyControlName.Requery ........ didn't work, but I may have dug up an
answer:
If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
MsgBox "Warning BlahBlah"
Else
DoCmd.OpenForm "MyFormName"
End If
It stops the process so forms don't come up to edit a non existant record.
Charlie
Try this,
Add the following line of code to your Edit/Delete buttons
' Requeries the ListCostItem listbox to the new values
ListCostItem.Requery
John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities
www.noclassroom.com
Live software training
Right over the Internet
Home: xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498
"Commit to the Lord whatever you do,
and your plans will succeed." Proverbs 16:3
-----Original Message-----
From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
t.com]]
Sent: Friday, December 20, 2002 8:47 AM
To: Access
Subject: [access] RE: Ghosts
The plot thickens.
My listbox seems to be retaining the last selected value, even if that value
is "impossible".
To diagnose, I created a text box with the control source: =3D[LstCostItem]
LstCostItem is a misbehaving listbox.
If I select a detail, say detail 500 from, transaction 100. the box
dutifully displays 500.
And then I move to main transaction record 101, without selecting a new
detail item at all, the display in the listbox changes, but the textbox
keeps showing 500 till I actually select a new detail. Once I make a new
selection, then everything works untill I move to a new record or remove the
previously selected item without selecting something further.
I have tried refreshing the form... adding other code to look for "" I
suspect that is'nt the problem. I seem to have to make a new selection or
close the form to exorcise the ghost of the previous selection....
Is my textbox telling me the truth about my errant listbox? Does this new
view of the problem help anyone help me?
Charlie
> if a field has enver had a value it is null, but if it had a value and
> then you deleted that value, the field value is "". Which is a heck
> of a lot like NULL but it isn't exactly NULL.
>
> (I hope this is correct and not a VB/VBA difference...)
>
> -----Original Message-----
> From: Haslett, Andrew [mailto:andrew.haslett@i...]
> Sent: Friday, December 20, 2002 3:09 AM
> To: Access
> Subject: [access] RE: Ghosts
>
>
> I've had this same problem. It seems to 'remember' that an item was
> previously selected.
>
> I'll go back and check the code, but I don't recall finding an answer.
> Let me know if you do!!
>
> Cheers,
> A
>
> -----Original Message-----
> From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
net.com]]
> [mailto:cgoodwin@c...]] [mailto:cgoodwin@c...]]]
> Sent: Friday, 20 December 2002 5:05 PM
> To: Access
> Subject: [access] Ghosts
>
>
> I have been converting continuous subforms in a DB into unbound
> listboxes with adjacent buttons to summon up forms that will add a new
> transaction detail item, edit the item or remove the item.
>
> If no item has been selected in the listbox and the edit or delete is
> clicked, then a messagebox warns the user to make a selection. All is
fine
> so far.
>
> If I do select and delete the item, which really just sets it's value
> to $0, the item disappears from the listbox just as it should, since
> queries / SQL in the listbox, (and pretty much everything else in the
> DB) are set to eliminate $0 values.
>
> The oddity is that if I then click on edit or delete buttons, when the
> list has nothing currently selected, but did since the form was
> opened, I do not get warning messageboxes, but instead the edit or
> delete forms are summoned up.
>
> Somehow, the listboxes are appearing to retain the "ghost" of the value
they
> last had, which would be the detail item selected previously. Since
> nothing is selected, I would guess the listbox should be null. On the
edit
> and delete buttons I have code like this:
>
> If IsNull([Form]![TransactionFormName]![ListName]) Then MsgBox
> "Warning text " Else
> DoCmd.OpenForm "EditOrDeleteFormName"
> End If
>
> Other than this odd behaviour, they're working fine.
>
> Any ideas?
>
> Charlie
> Try this,
>
> Add the following line of code to your Edit/Delete buttons
>
> ' Requeries the ListCostItem listbox to the new values
> ListCostItem.Requery
>
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
>
> www.noclassroom.com
> Live software training
> Right over the Internet
>
> Home: xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
>
> "Commit to the Lord whatever you do,
> and your plans will succeed." Proverbs 16:3
>
>
>
> -----Original Message-----
> From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
net.com]] [mailto:cgoodwin@c...]] [mailto:cgoodwin@c...]]]
> Sent: Friday, December 20, 2002 8:47 AM
> To: Access
> Subject: [access] RE: Ghosts
>
>
> The plot thickens.
>
> My listbox seems to be retaining the last selected value, even if that va
lue
> is "impossible".
>
> To diagnose, I created a text box with the control source: =3D[LstCostIt
em]
> LstCostItem is a misbehaving listbox.
>
> If I select a detail, say detail 500 from, transaction 100. the box
> dutifully displays 500.
>
> And then I move to main transaction record 101, without selecting a new
> detail item at all, the display in the listbox changes, but the textbox
> keeps showing 500 till I actually select a new detail. Once I make a new
> selection, then everything works untill I move to a new record or remove
the
> previously selected item without selecting something further.
>
> I have tried refreshing the form... adding other code to look for "" I
> suspect that is'nt the problem. I seem to have to make a new selection
or
> close the form to exorcise the ghost of the previous selection....
>
> Is my textbox telling me the truth about my errant listbox? Does this n
ew
> view of the problem help anyone help me?
>
> Charlie
>
>
>
>
>
>
>
> > if a field has enver had a value it is null, but if it had a value and
> > then you deleted that value, the field value is "". Which is a heck
> > of a lot like NULL but it isn't exactly NULL.
> >
> > (I hope this is correct and not a VB/VBA difference...)
> >
> > -----Original Message-----
> > From: Haslett, Andrew [mailto:andrew.haslett@i...]
> > Sent: Friday, December 20, 2002 3:09 AM
> > To: Access
> > Subject: [access] RE: Ghosts
> >
> >
> > I've had this same problem. It seems to 'remember' that an item was
> > previously selected.
> >
> > I'll go back and check the code, but I don't recall finding an answer.
> > Let me know if you do!!
> >
> > Cheers,
> > A
> >
> > -----Original Message-----
> > From: Charlie Goodwin [mailto:cgoodwin@c...] [mailto:cgoodwin@c...
nknet.com]] [mailto:cgoodwin@c...]] [mailto:cgoodwin@c...]]]
> > [mailto:cgoodwin@c...]] [mailto:cgoodwin@c...]]] [mailto:
cgoodwin@c...]]] [mailto:cgoodwin@c...]]]]
> > Sent: Friday, 20 December 2002 5:05 PM
> > To: Access
> > Subject: [access] Ghosts
> >
> >
> > I have been converting continuous subforms in a DB into unbound
> > listboxes with adjacent buttons to summon up forms that will add a new
> > transaction detail item, edit the item or remove the item.
> >
> > If no item has been selected in the listbox and the edit or delete is
> > clicked, then a messagebox warns the user to make a selection. All is
> fine
> > so far.
> >
> > If I do select and delete the item, which really just sets it's value
> > to $0, the item disappears from the listbox just as it should, since
> > queries / SQL in the listbox, (and pretty much everything else in the
> > DB) are set to eliminate $0 values.
> >
> > The oddity is that if I then click on edit or delete buttons, when the
> > list has nothing currently selected, but did since the form was
> > opened, I do not get warning messageboxes, but instead the edit or
> > delete forms are summoned up.
> >
> > Somehow, the listboxes are appearing to retain the "ghost" of the value
> they
> > last had, which would be the detail item selected previously. Since
> > nothing is selected, I would guess the listbox should be null. On the
> edit
> > and delete buttons I have code like this:
> >
> > If IsNull([Form]![TransactionFormName]![ListName]) Then MsgBox
> > "Warning text " Else
> > DoCmd.OpenForm "EditOrDeleteFormName"
> > End If
> >
> > Other than this odd behaviour, they're working fine.
> >
> > Any ideas?
> >
> > Charlie
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to
> > unsubscribe send a blank email to
> >
> > IMPORTANT - PLEASE READ ********************
> > This email and any files transmitted with it are confidential and may
> > contain information protected by law from disclosure. If you have
> > received this message in error, please notify the sender immediately
> > and delete this email from your system. No warranty is given that this
> > email or files, if attached to this email, are free from computer
> > viruses or other defects. They are provided on the basis the user
> > assumes all responsibility for loss, damage or consequence resulting
> > directly or indirectly from their use, whether caused by the
> > negligence of the sender or not.
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to
> > unsubscribe send a blank email to
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to
> > unsubscribe send a blank email to
>
>
>
>
Message #8 by "Bob Bedell" <bobbedell15@m...> on Sat, 21 Dec 2002 18:47:03 +0000
|
|
Hi Charlie,
The Requery method seemed like the way to go to me too. When I'm using
a listbox as a subform, I often requery the listbox in two events
associated with the parent form:
Private Sub Form_Current()
Me!lstMyListBox.Requery
End Sub
This keeps the 'child' list box synchronized with the parent form as I'm
navigating through the records on the parent form. The 'link field'
between the parent form and the listbox would be something like a
ClientID field on the parent form that appears as a parameter field in
the query underlying the list box's row source: [Forms]![frmClient]!
[ClientID].
The second place is:
Private Sub Form_Activate()
Me!lstMyListBox.Requery
End Sub
Here, if I open a form from the parent form to edit the content of the
list box, the list box is requeried when the second form is closed and
the listbox's parent form again becomes the active form.
A couple more options to try.
Bob
>From: "Charlie Goodwin" <cgoodwin@c...>
>Reply-To: "Access" <access@p...>
>To: "Access" <access@p...>
>CC: "andrew.haslett@i..." <andrew.haslett@i...>
>Subject: [access] RE: Ghosts
>Date: Sat, 21 Dec 2002 01:17:27 -0500
>
>MyControlName.Requery ........ didn't work, but I may have dug up an
>answer:
>
>
>If [LstCostItem]![ItemsSelected]![Count] = 0 Then
_________________________________________________________________
The new MSN 8: smart spam protection and 3 months FREE*.
http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU=
http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf
Message #9 by "Charlie Goodwin" <cgoodwin@c...> on Sun, 22 Dec 2002 01:00:56 -0500
|
|
Hi Bob,
Thanks for the suggestions. I have tried using the
Private Sub Form_Current()
Me!lstMyListBox.Requery
End Sub
that you suggested. I added a text box with =3D [lstMyListBox] as the sou
rce.
It retains the value once a selection is made, even when the form is ponite
d at a different record and the value is no longer appropriate, until anoth
er selection is made, when the value changes and is correct.
I can't figure out why a requery doesn't seem to clear the value, but it ma
y not matter now.
So far, the code:
If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
MsgBox "Warning BlahBlah"
Else
DoCmd.OpenForm "MyFormName"
End If
attached to the button that opens the form for editing a detail item seems
to be working just right.
The [ItemsSelected]![Count] expression seems to be aware of how many items
are selected on a real time basis, and seems to give me what I needed - a w
ay to keep from pulling up meaningless values. The minute I move to a diff
erent record, [LstCostItem]![ItemsSelected]![Count] changes to 0, since det
ail records are unique
If no item is currently selected, I don't want to open an editing form, and
the retained value is not an issue as long as I can stop the editing form
from opening if no item is currently selected.
I am guessing the [ItemsSelected]![Count] expression was mainly meant for m
ultiselect lists, but it seemed like just the thing for me here.
I won't yet declare total victory, since issues come up as I go along, but
I haven't been able to trip the [ItemsSelected]![Count] expression up yet..
Thanks for the suggestions and help!
Charlie
> Hi Charlie,
>
> The Requery method seemed like the way to go to me too. When I'm using
> a listbox as a subform, I often requery the listbox in two events
> associated with the parent form:
>
> Private Sub Form_Current()
> Me!lstMyListBox.Requery
> End Sub
>
> This keeps the 'child' list box synchronized with the parent form as I'm
> navigating through the records on the parent form. The 'link field'
> between the parent form and the listbox would be something like a
> ClientID field on the parent form that appears as a parameter field in
> the query underlying the list box's row source: [Forms]![frmClient]!
> [ClientID].
>
> The second place is:
>
> Private Sub Form_Activate()
> Me!lstMyListBox.Requery
> End Sub
>
> Here, if I open a form from the parent form to edit the content of the
> list box, the list box is requeried when the second form is closed and
> the listbox's parent form again becomes the active form.
>
> A couple more options to try.
>
>
> Bob
>
>
>
> >From: "Charlie Goodwin" <cgoodwin@c...>
> >Reply-To: "Access" <access@p...>
> >To: "Access" <access@p...>
> >CC: "andrew.haslett@i..." <andrew.haslett@i...>
> >Subject: [access] RE: Ghosts
> >Date: Sat, 21 Dec 2002 01:17:27 -0500
> >
> >MyControlName.Requery ........ didn't work, but I may have dug up
an
> >answer:
> >
> >
> >If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
>
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 3 months FREE*.
> http://join.msn.com/?page=3Dfeatures/junkmail&xAPID=3D42&PS=3D47575&PI=3D
7324&DI=3D7474&SU=3D
> http://www.hotmail.msn.com/cgi-bin/getmsg&HL=3D1216hotmailtaglines_smarts
pamprotection_3mf
>
>
Message #10 by "Bob Bedell" <bobbedell15@m...> on Sun, 22 Dec 2002 07:36:05
|
|
A final thought would be:
Private Sub Form_Current()
With Me!lstMyListBox
.Requery
.Value = Null
End With
End Sub
You'll notice that the ghost value is gone from your textbox at least.
> Hi Bob,
Thanks for the suggestions. I have tried using the
Private Sub Form_Current()
Me!lstMyListBox.Requery
End Sub
that you suggested. I added a text box with =3D [lstMyListBox] as the
sou
rce.
It retains the value once a selection is made, even when the form is
ponite
d at a different record and the value is no longer appropriate, until
anoth
er selection is made, when the value changes and is correct.
I can't figure out why a requery doesn't seem to clear the value, but it
ma
y not matter now.
So far, the code:
If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
MsgBox "Warning BlahBlah"
Else
DoCmd.OpenForm "MyFormName"
End If
attached to the button that opens the form for editing a detail item seems
to be working just right.
The [ItemsSelected]![Count] expression seems to be aware of how many items
are selected on a real time basis, and seems to give me what I needed - a
w
ay to keep from pulling up meaningless values. The minute I move to a
diff
erent record, [LstCostItem]![ItemsSelected]![Count] changes to 0, since
det
ail records are unique
If no item is currently selected, I don't want to open an editing form,
and
the retained value is not an issue as long as I can stop the editing form
from opening if no item is currently selected.
I am guessing the [ItemsSelected]![Count] expression was mainly meant for
m
ultiselect lists, but it seemed like just the thing for me here.
I won't yet declare total victory, since issues come up as I go along, but
I haven't been able to trip the [ItemsSelected]![Count] expression up yet..
Thanks for the suggestions and help!
Charlie
> Hi Charlie,
>
> The Requery method seemed like the way to go to me too. When I'm using
> a listbox as a subform, I often requery the listbox in two events
> associated with the parent form:
>
> Private Sub Form_Current()
> Me!lstMyListBox.Requery
> End Sub
>
> This keeps the 'child' list box synchronized with the parent form as I'm
> navigating through the records on the parent form. The 'link field'
> between the parent form and the listbox would be something like a
> ClientID field on the parent form that appears as a parameter field in
> the query underlying the list box's row source: [Forms]![frmClient]!
> [ClientID].
>
> The second place is:
>
> Private Sub Form_Activate()
> Me!lstMyListBox.Requery
> End Sub
>
> Here, if I open a form from the parent form to edit the content of the
> list box, the list box is requeried when the second form is closed and
> the listbox's parent form again becomes the active form.
>
> A couple more options to try.
>
>
> Bob
>
>
>
> >From: "Charlie Goodwin" <cgoodwin@c...>
> >Reply-To: "Access" <access@p...>
> >To: "Access" <access@p...>
> >CC: "andrew.haslett@i..." <andrew.haslett@i...>
> >Subject: [access] RE: Ghosts
> >Date: Sat, 21 Dec 2002 01:17:27 -0500
> >
> >MyControlName.Requery ........ didn't work, but I may have dug up
an
> >answer:
> >
> >
> >If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
>
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 3 months FREE*.
> http://join.msn.com/?
page=3Dfeatures/junkmail&xAPID=3D42&PS=3D47575&PI=3D
7324&DI=3D7474&SU=3D
> http://www.hotmail.msn.com/cgi-
bin/getmsg&HL=3D1216hotmailtaglines_smarts
pamprotection_3mf
>
>
Message #11 by "Bob Bedell" <bobbedell15@m...> on Sun, 22 Dec 2002 08:03:23
|
|
That is odd behaviour. I guess the value property on an unbound
list box just needs to be explicitly reset to Null in this way.
Your original code:
If IsNull([Form]![TransactionFormName]![ListName]) Then
MsgBox "Warning text "
Else
DoCmd.OpenForm "EditOrDeleteFormName"
End If
should run now.
> A final thought would be:
> Private Sub Form_Current()
> With Me!lstMyListBox
> .Requery
> .Value = Null
> End With
E> nd Sub
> You'll notice that the ghost value is gone from your textbox at least.
>
>
> > Hi Bob,
> Thanks for the suggestions. I have tried using the
> Private Sub Form_Current()
M> e!lstMyListBox.Requery
E> nd Sub
> that you suggested. I added a text box with =3D [lstMyListBox] as the
s> ou
r> ce.
> It retains the value once a selection is made, even when the form is
p> onite
d> at a different record and the value is no longer appropriate, until
a> noth
e> r selection is made, when the value changes and is correct.
> I can't figure out why a requery doesn't seem to clear the value, but it
m> a
y> not matter now.
> So far, the code:
> If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
M> sgBox "Warning BlahBlah"
E> lse
D> oCmd.OpenForm "MyFormName"
E> nd If
> attached to the button that opens the form for editing a detail item
seems
=>
t> o be working just right.
> The [ItemsSelected]![Count] expression seems to be aware of how many
items
=>
a> re selected on a real time basis, and seems to give me what I needed -
a
w>
a> y to keep from pulling up meaningless values. The minute I move to a
d> iff
e> rent record, [LstCostItem]![ItemsSelected]![Count] changes to 0, since
d> et
a> il records are unique
> If no item is currently selected, I don't want to open an editing form,
a> nd
> the retained value is not an issue as long as I can stop the editing
form
=>
f> rom opening if no item is currently selected.
I> am guessing the [ItemsSelected]![Count] expression was mainly meant
for
m>
u> ltiselect lists, but it seemed like just the thing for me here.
> I won't yet declare total victory, since issues come up as I go along,
but
=>
I> haven't been able to trip the [ItemsSelected]![Count] expression up
yet..
> Thanks for the suggestions and help!
> Charlie
>
>
> > Hi Charlie,
>>
>> The Requery method seemed like the way to go to me too. When I'm using
>> a listbox as a subform, I often requery the listbox in two events
>> associated with the parent form:
>>
>> Private Sub Form_Current()
>> Me!lstMyListBox.Requery
>> End Sub
>>
>> This keeps the 'child' list box synchronized with the parent form as
I'm
>> navigating through the records on the parent form. The 'link field'
>> between the parent form and the listbox would be something like a
>> ClientID field on the parent form that appears as a parameter field in
>> the query underlying the list box's row source: [Forms]![frmClient]!
>> [ClientID].
>>
>> The second place is:
>>
>> Private Sub Form_Activate()
>> Me!lstMyListBox.Requery
>> End Sub
>>
>> Here, if I open a form from the parent form to edit the content of the
>> list box, the list box is requeried when the second form is closed and
>> the listbox's parent form again becomes the active form.
>>
>> A couple more options to try.
>>
>>
>> Bob
>>
>>
>>
>> >From: "Charlie Goodwin" <cgoodwin@c...>
>> >Reply-To: "Access" <access@p...>
>> >To: "Access" <access@p...>
>> >CC: "andrew.haslett@i..." <andrew.haslett@i...>
>> >Subject: [access] RE: Ghosts
>> >Date: Sat, 21 Dec 2002 01:17:27 -0500
>> >
>> >MyControlName.Requery ........ didn't work, but I may have dug
up
=>
a> n
>> >answer:
>> >
>> >
>> >If [LstCostItem]![ItemsSelected]![Count] =3D 0 Then
>>
>>
>> _________________________________________________________________
>> The new MSN 8: smart spam protection and 3 months FREE*.
>> http://join.msn.com/?
p> age=3Dfeatures/junkmail&xAPID=3D42&PS=3D47575&PI=3D
7> 324&DI=3D7474&SU=3D
>> http://www.hotmail.msn.com/cgi-
b> in/getmsg&HL=3D1216hotmailtaglines_smarts
p> amprotection_3mf
>>
>>
|
|
 |