Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2008

Tip: Looking for answers? Try searching our database.

message box issues

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
starkbergs@gmail.com - 14 Jan 2008 17:22 GMT
I am working on a form "A" and i have created a Message box that has
'yes' and 'No' options.

if i click on the  yes button then it should open up a new form "B"
for me,But if i click on the No option then it should let me stay in
the same form that i have been working previsiouly.

I have this code here.Can anyone help me as to what i am missing here.

Private Sub Form_Open(Cancel As Integer)
If IsNull(CompanyID) Or IsNull(InspectorID) Then
MsgBox "", vbYesNo + vbCritical + vbDefaultButton2
If Response = vbYes Then
DoCmd.OpenForm "", , , , acFormAdd
Else
If Response = vbNo then
Exit Sub
End if
David Sisson - 14 Jan 2008 18:28 GMT
This is a Word group, but the command in Access seems to be the same.

Try,

Private Sub Form_Open(Cancel As Integer)
If IsNull(CompanyID) Or IsNull(InspectorID) Then
   Response = InputBox("", vbYesNo + vbCritical + vbDefaultButton2)
   If Response = vbYes Then
   DoCmd.OpenForm "", , , , acFormAdd 'I'm not sure about this.
Else
   If Response = vbNo Then
   Exit Sub
End If
starkbergs@gmail.com - 16 Jan 2008 13:36 GMT
> This is a Word group, but the command in Access seems to be the same.
>
[quoted text clipped - 9 lines]
>     Exit Sub
> End If

Thank you so much.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.