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

Auto Edit record by clicking on listbox

jmoudy77
P: 20
Hi,

I'v created an internal messaging system within my database. I've got a listbox that displays the current user's messages. When a message in the listbox is clicked on, a listbox below that is populated with the body of that message. My goal is to have the "read status" field for the messages table to change to "Yes" when I click on the listbox as well. I know I need to code this in VB, but really have no idea where to start. Any suggestions?

Thanks,
Josh
Mar 15 '08 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 2.5K+
P: 2,545
Hi,

I'v created an internal messaging system within my database. I've got a listbox that displays the current user's messages. When a message in the listbox is clicked on, a listbox below that is populated with the body of that message. My goal is to have the "read status" field for the messages table to change to "Yes" when I click on the listbox as well. I know I need to code this in VB, but really have no idea where to start. Any suggestions?

Thanks,
Josh
Hi. You could add code to the On Got Focus event of the list box to change the read status field to "Yes". Right-click on the On Got Focus event within the Properties tab of the listbox and select Build, Code Builder to bring up the VB editor. The builder places a skeleton of the event subroutine into the code for you, and all you have to do is add
Expand|Select|Wrap|Line Numbers
  1. Me![read status]="Yes"
then save the changes. It's really easy to do.

I assume that your "read status" field is a text field. If it is a Yes/No (boolean) field then substitute
Expand|Select|Wrap|Line Numbers
  1. Me![read status]=True
instead.

-Stewart
Mar 15 '08 #2

jmoudy77
P: 20
Thanks Stewart,

I ended up using an update query. You're suggestion would have worked also, but I didn't have the "read status" field displayed in the listbox. This field is never displayed, and only used to update the user's unread mail status on their homepage. Thanks for the help though.
Mar 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.