Custom Message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I hv a front end & back end system. Can i customise the pop up message that
appear when user with FE try to open the system but the server is down. Maybe
something like "Sorry the server is down"
 
Hi:

You can have some code which runs on startup of database to do the
following. Click Tools | Startup and if you have a Startup form run some
code in this forms Form_Open event in VBA.

I assume you have some linked tables in your front end database and these
linked tables will not open if back end connection is invalid or server is
down. Let us assume you have a linked table called "tblClients".


'---- CODE ON STARTUP FORM FORM_OPEN EVENT -----------------
Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDB()
On error resume next
Err.Number = 0
Set rs = db.OpenRecordSet("Select * from tblClients",dbOpenSnapshot)
If Err.Number <> 0 then
Msgbox "Sorry the server is down",vbInformation
Exit Sub
End if
On error goto 0
rs.Close
Set rs = nothing
db.Close
Set db = Nothing
'----------- End Code ------------------

The code tries to open a linked table - if it fails it gives a message.

Regards,

Naresh Nichani
Microsoft Access MVP
 
Hi,

What if i have a few linked tables

Naresh Nichani said:
Hi:

You can have some code which runs on startup of database to do the
following. Click Tools | Startup and if you have a Startup form run some
code in this forms Form_Open event in VBA.

I assume you have some linked tables in your front end database and these
linked tables will not open if back end connection is invalid or server is
down. Let us assume you have a linked table called "tblClients".


'---- CODE ON STARTUP FORM FORM_OPEN EVENT -----------------
Dim db as DAO.Database
Dim rs as DAO.Recordset

Set db = CurrentDB()
On error resume next
Err.Number = 0
Set rs = db.OpenRecordSet("Select * from tblClients",dbOpenSnapshot)
If Err.Number <> 0 then
Msgbox "Sorry the server is down",vbInformation
Exit Sub
End if
On error goto 0
rs.Close
Set rs = nothing
db.Close
Set db = Nothing
'----------- End Code ------------------

The code tries to open a linked table - if it fails it gives a message.

Regards,

Naresh Nichani
Microsoft Access MVP
 
If it fails for a single linked table it means the backend is not
linked.

I am assuming all linked tables are linked to same backend database.

If not check for each linked table which is linked to a distinct
backend database.

Regards,

Naresh Nichani
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top