message box

eggwater

life as a rehearsal
Local time
Today, 12:20
Joined
Aug 14, 2003
Messages
69
howdy folks

what i want to do is have a msg box appear when a user clicks a button to Export records.

the message box will say " You are about to export (x no. of records). This will update the current data base. Are you sure you wish to continue?"

x will get it's total from a count query

is this possible? I've tried to do this a number of ways but can't seem to get the expression or SQL right - I'm kinda thinking you gotta do it in VB.

please help
 
Hmmm, i might get the syntax wrong a bit but here goes

Code:
sub ExportCmd_click()
      dim rs as new adodb.recordset
      dim sql as string

      sql  = "Select the records for export"       'you need to change this sql statement to retrive the files for exporting
      rs.open sql,currentproject.connection, adOpenKeyset,adLockOptimistic 
      
      if not rs.eof then
           if msgbox("You are about to export (" & rs.recordcount & " no. of records). This will update the current data base. Are you sure you wish to continue?" ,vbyesno) = vbyes then
                  'start your export code here
           end if
      else
             'no records to export
      end if
      rs.close
      set rs = nothing

end sub

:cool:ShadeZ:cool:
 
Last edited:
Shadez said:
Hmmm, i might get the syntax wrong a bit but here goes

Code:
rs.reocordcount


Careful with spelling though! :D
 
Mile-O-Phile said:

Careful with spelling though! :D


Doh! :rolleyes: :eek:

How did i miss such a typo :confused: :confused:

Ta m8 for spotting it, fixed it now :p
 
Just a thought you might want to spread your msgbox over more than one line, you can do this using :

vbcrlf

ie

Code:
msgbox("You are about to export (" & rs.recordcount & " no. of records)." & vbcrlf & "This will update the current data base." & vbcrlf & "Are you sure you wish to continue?" ,vbyesno)
 
Hi Eggwater: Be good to see your completed code when you have incorporated these suggestions, if you wouldn't mind. Cheers
 

Users who are viewing this thread

Back
Top Bottom