473,473 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Auto Edit record by clicking on listbox

jmoudy77
20 New Member
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
2 1849
Stewart Ross
2,545 Recognized Expert Moderator Specialist
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
20 New Member
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

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

Similar topics

25
by: dixie | last post by:
I have some code that adds new records into a table for each ID in a list box when a button on a form is clicked. This works fine. My problem now is that I wish to be able to edit all the records...
3
by: Sarah Smith via AccessMonster.com | last post by:
I am creating a database of documents that need to be worked on, are int eh proress of being worked on, and have been completed. Sometimes the same document (an updated version) comes back for more...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
1
by: Jim | last post by:
I have a new database in which I have a form where in one field I type a letter A, B, C or D and the field next to it autofills (auto lookups) with a description associated with the specific...
8
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
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
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.