Can someone tell me why this doesn't work please 
Author Message
 Can someone tell me why this doesn't work please

Hi - This is the code that I've put behind a customised appointment form.
CarRequired is a tickbox (values true/false),  GuestName is just a text box.
When run, the only thing that fires is the msgbox right at the end. Can
anyone point out what I've done wrong.

Thanks, Gareth

Function Item_Send()

'Set variables

Dim objApp
Dim objNS
Dim objBooking_Email
Dim strGuestNames()

'Check that Form has been filled in
If CarRequired = True then
 If IsEmpty(GuestName) = FALSE Then
  'Create an email object
  Set objApp = CreateObject("outlook.application")
  Set objBooking_Email = objApp.CreateItem(olMailItem)

  'Enter email address, title and body info
  With objBooking_Email
   .Subject = "Bloomberg TV Car Request"

   .Body = "Customer Number = 6618 Bloomberg/London" & vbCrLf & "Name of
traveller:" & _
   txtGuest_Name & vbCrLf & "Pick Up Address:" & vbCrLf &
txtGuest_Pickup_address & _
   vbCrLf & "Destination: Citygate House" & vbCrLf & "Pick-Up Time/Date:" &
txtGuest_Pickup_Time & _
   " - " & txtGuest_Date
   .Send
  End With

 Else
      MsgBox "Please enter a Name for the Guest"
  Cancel=True
 End If
End If

Msgbox "Don't forget to arrange Badge for your guest!"

End Function



Tue, 07 Oct 2003 19:34:58 GMT  
 Can someone tell me why this doesn't work please
You have not told the script what GuestName is. Try changing it to something
like this:

Check that Form has been filled in
If CarRequired = True then
If IsEmpty(FormName.GuestName.Value) = FALSE Then

That should fix it for you I think.

Stephen


Quote:
> Hi - This is the code that I've put behind a customised appointment form.
> CarRequired is a tickbox (values true/false),  GuestName is just a text
box.
> When run, the only thing that fires is the msgbox right at the end. Can
> anyone point out what I've done wrong.

> Thanks, Gareth

> Function Item_Send()

> 'Set variables

> Dim objApp
> Dim objNS
> Dim objBooking_Email
> Dim strGuestNames()

> 'Check that Form has been filled in
> If CarRequired = True then
>  If IsEmpty(GuestName) = FALSE Then
>   'Create an email object
>   Set objApp = CreateObject("outlook.application")
>   Set objBooking_Email = objApp.CreateItem(olMailItem)

>   'Enter email address, title and body info
>   With objBooking_Email
>    .Subject = "Bloomberg TV Car Request"

>    .Body = "Customer Number = 6618 Bloomberg/London" & vbCrLf & "Name of
> traveller:" & _
>    txtGuest_Name & vbCrLf & "Pick Up Address:" & vbCrLf &
> txtGuest_Pickup_address & _
>    vbCrLf & "Destination: Citygate House" & vbCrLf & "Pick-Up Time/Date:"
&
> txtGuest_Pickup_Time & _
>    " - " & txtGuest_Date
>    .Send
>   End With

>  Else
>       MsgBox "Please enter a Name for the Guest"
>   Cancel=True
>  End If
> End If

> Msgbox "Don't forget to arrange Badge for your guest!"

> End Function



Wed, 08 Oct 2003 00:39:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Can someone tell me why this eval() doesn't work in IE

2. Can you please tell me why this don't work

3. Why LoadPicture() works on local pathes and doesn't work on the URLS

4. works / doesn't work, why?

5. Why doesn't this work

6. Why doesn't it work?

7. Why doesn't this work?

8. newbie: aarrggh - why doesn't this work?

9. RegExp question, why doesn't this work?

10. Why doesn't this work!

11. Puzzled: Why doesn't this work?

12. Help needed !! Why doesn't this work

 

 
Powered by phpBB® Forum Software