Converting number to text in messagebox (1 Viewer)

Ravi Kumar

Registered User.
Local time
Today, 08:26
Joined
Aug 22, 2019
Messages
162
Dear all,

In my main menu form I have provided a button to check the tasks due as a reminder.
In this assigned to field is coming as number , because in in my table it is of number type & it is linked to contact table to retrieve the data.
So in my message box I need this number to be converted as the data stored my contact table.
& also I can't increase the size of the message box so it is looking messy.
My Db is attached kindly check once & suggest me the solution.
 

Attachments

  • Task Scheduling.zip
    515.7 KB · Views: 71

June7

AWF VIP
Local time
Yesterday, 18:56
Joined
Mar 9, 2014
Messages
5,466
Should probably build a report if you want data arranged horizontally because cannot make intrinsic message box wider.

What is vTab supposed to do? Apparently it should be vbTab. Add Option Explicit to module header and compiler will show vTab is an error.

If you want text instead of ID number, build a query that joins tables and use that query as data source in code. Probably should apply filter criteria so only tasks that are still due are retrieved.

SELECT Tasks.Title, Contacts.Company, Tasks.[Due Date], Tasks.[Completed Date]
FROM Contacts RIGHT JOIN Tasks ON Contacts.ID = Tasks.[Assigned To]
WHERE (((Tasks.[Completed Date]) Is Null));

Strongly advise not to use spaces nor punctuation/special characters in naming convention.
 
Last edited:

Ravi Kumar

Registered User.
Local time
Today, 08:26
Joined
Aug 22, 2019
Messages
162
Should probably build a report if you want data arranged horizontally because cannot make intrinsic message box wider.

What is vTab supposed to do? Apparently it should be vbTab. Add Option Explicit to module header and compiler will show vTab is an error.

If you want text instead of ID number, build a query that joins tables and use that query as data source in code. Probably should apply filter criteria so only tasks that are still due are retrieved.

SELECT Tasks.Title, Contacts.Company, Tasks.[Due Date], Tasks.[Completed Date]
FROM Contacts RIGHT JOIN Tasks ON Contacts.ID = Tasks.[Assigned To]
WHERE (((Tasks.[Completed Date]) Is Null));

Strongly advise not to use spaces nor punctuation/special characters in naming convention.
Thank you , I created a query as you told but the field due date is showing as empty.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:56
Joined
Feb 19, 2002
Messages
43,233
If you want to use a "messagebox" but the built in one doesn't provide the features you need, build a form. Open it modal so it acts like a messagebox.
 

June7

AWF VIP
Local time
Yesterday, 18:56
Joined
Mar 9, 2014
Messages
5,466
Query works for me. Records that have a due date show a due date. Not all task records have a due date.
 

Ravi Kumar

Registered User.
Local time
Today, 08:26
Joined
Aug 22, 2019
Messages
162
Query works for me. Records that have a due date show a due date. Not all task records have a due date.
Thank you for your reply, And I do know that records which have due will show the due date .
but the problem was even if it is due ,title & assigned to was visible & due date was not , made some changes in SQL and now it is good.
Thank you so much for your help.
 

Users who are viewing this thread

Top Bottom