Solved Display Current Record No & Bold this line or Numbers (1 Viewer)

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
Hi once again,
In my database worked before display current record numbers. But today my daughter do something that now dont display.
Have attached demo database, Please check where have mistake ?
And also need bold this second line OR Current Record Numbers only.
If any color much better.

Thank you so much.
 

Attachments

  • DisplayMsg.accdb
    560 KB · Views: 104

moke123

AWF VIP
Local time
Today, 08:18
Joined
Jan 11, 2013
Messages
3,912
Assuming your talking about the msgbox, I'm not aware of anyway to bold text without using a custom msgbox.

You left out the arguments for Debug.print eval() thus the compile error.

you have the quotations in the wrong places in your message string.

Edit: I stand corrected. Apparently the MsgBold will do that. I'll have to experiment a bit before I can answer your question.
 
Last edited:

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
I tried to Debug.Print Eval() but it came Error.
 

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
If message box have some problem, I try second ways. Here showed, But I think I have to add something before .......... vbOKCancel, "Seccessful!")
 

Attachments

  • Untitled.png
    Untitled.png
    33.7 KB · Views: 110

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
ID no is show now, I get it another ways.

But needs if any help BOLD second line
 

moke123

AWF VIP
Local time
Today, 08:18
Joined
Jan 11, 2013
Messages
3,912
oops forgot to hit post.

'm assuming you got this from this code. I'm not quite sure how this works.
Code:
Option Compare Database
Option Explicit

Public Function TestBoldMsgBox()

    Dim MsgBold As String
    Dim MsgNormal As String

    MsgBold = "This is a Bold Message"
    MsgNormal = "This is a  Normal Message"

    Debug.Print Eval("MsgBox ('" & MsgBold & vbNewLine _
    & "@" & MsgNormal & "@@', " & vbOKOnly & ", 'Testing Bold')")

End Function
 

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
Gasman & Moke thanks for your reply. I try it before, But when I put Debug.Print Eval (...................)
There is my code like that
Code:
Private Sub Command4_Click()
    Dim VarID As String
    Dim MsgBold As String
   
    Dim ShipmentData As Integer
    Dim Response As Integer
   
    'ID Numbers value
    VarID = Me.ID.Value
   
   
If IsNull(Me.Date) Then 'Date
    MsgBox "Please enter the shipment date", vbInformation, "Date Required"
    Me.Date.SetFocus
   
Else
    If ShipmentData = 1 Then
    Else
    Debug.Print
   
    'Record Msg
    Response = MsgBox("Your data has been saved successfully." & vbCrLf & _
    "Your current record numbers is " & VarID & "", vbOKCancel, "Seccessful!")
           
        If Response = vbOK Then
           DoCmd.GoToRecord , , acNewRec
           Me.Date.SetFocus
        Else
    End If
    End If
End If

End Sub

If I put Eval(), not work, I dont know why
Can add here BOLD code please
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:18
Joined
Sep 21, 2011
Messages
14,234
Just discovered this (again via Google) that uses a class. Pretty neat. Albeit in an Excel workbook, but.......
Post #3
 

moke123

AWF VIP
Local time
Today, 08:18
Joined
Jan 11, 2013
Messages
3,912
Smt,
The procedure your attempting to use is not native to vba and thus the need to use eval for it to function.
I would suggest you google custom msgboxes. There are a number of them out there and they are usually somewhat easy to incorporate into a DB.
 

isladogs

MVP / VIP
Local time
Today, 13:18
Joined
Jan 14, 2017
Messages
18,209

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
This should help:
Thanks for reply. I have many example. But problem this criteria (=) after not work. And I dont know why, check my DB here also Eval () not work.
Code:
Response = MsgBox("Your data has been saved successfully." & vbCrLf & _
    "Your current record numbers is " & VarID & "", vbOKCancel, "Seccessful!")
It is work without criteria (=) or normal messaged.
 

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
@smtazulislam
Did you look at the two links I provided in post #13? If so, were either of them useful?
Thanks @isladogs for your reply. I see your two example is nice, but I can't solve my problem what I suffering. I apologies, Normally it's work. When I deploying conditional as "msg no 15" then it is not work. even Eval () also not work. what happened I don't know. I spent 7 hours for this, many ways I tried, but result is zero....
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:18
Joined
Sep 21, 2011
Messages
14,234
IMHO option in #7 which has been mentioned several times is the simplest.?
Just change the order of the lines so that the required line is the first and bold.? Is it worth all this time being wasted not to do that.?

Alternatively the method in post 11 allows you to produce pretty much anything by the looks of it as shown below.
Then there the other methods?

I can be stubborn at times myself, but even I would realise I am wasting valuable development time over such a small issue? :(

1596614266076.png
 

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
IMHO option in #7 which has been mentioned several times is the simplest.?
Just change the order of the lines so that the required line is the first and bold.? Is it worth all this time being wasted not to do that.?

Alternatively the method in post 11 allows you to produce pretty much anything by the looks of it as shown below.
Then there the other methods?

I can be stubborn at times myself, but even I would realise I am wasting valuable development time over such a small issue? :(

View attachment 84048
Thanks for take times to reply. Please read again my Post msg 15, I tried it, but it is after "Response = MsgBox(".......................") not work. Please once you try and give me feedback where are my fault/missing. I think I should change this line Response = MsgBox (".........")
Response (variable) = msgBox _
msgbox as follow any method in this thread discuses.
And Debug.Print eval() also not work. All happened with me I dont know why ?
By way, If you have any way know to separate this two line.
1. MsgBox
2. Response (Variable)
I think this ways can possible to solve this issue
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:18
Joined
Sep 21, 2011
Messages
14,234
I would use the example from post 7, and create your bold message and normal message (same names if need be) and just copy and paste.

TBH I am at a loss as to why you cannot get it to work?

The picture shows my using it in the immediate window?
I have also added a iResponse and debug.print of it after it is populated and the result is in the second picture.

1596619424388.png


1596619506060.png
 

smtazulislam

Member
Local time
Today, 15:18
Joined
Mar 27, 2020
Messages
806
I would use the example from post 7, and create your bold message and normal message (same names if need be) and just copy and paste.

TBH I am at a loss as to why you cannot get it to work?

The picture shows my using it in the immediate window?
I have also added a iResponse and debug.print of it after it is populated and the result is in the second picture.
Thank you so much. I appreciate for it. Excellent !
You see I confused about this Response(variable), Now separate and work properly .
Thanks once again.
 

Users who are viewing this thread

Top Bottom