A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

not in list open a form



 
 
Thread Tools Display Modes
  #11  
Old December 29th, 2006, 03:03 PM posted to microsoft.public.access.forms
winty03
external usenet poster
 
Posts: 12
Default not in list open a form

Your right I didn't see that word wrap, but the DoCmd.OpenForm line is
still red and erroring..I have this code.


Private Sub Service_NotInList(NewData As String, Response As Integer)

If MsgBox("The Agency Entered is not in database, would you like to
add it?", _
vbYesNo) = vbYes Then

DoCmd.OpenForm "frmRequestingAgency", , , , acFormAdd,
acDialog,
NewData
Response = acDataErrAdded
Else
Me!Service = Me!Service.OldValue
DoCmd.Close
End If


End Sub

  #12  
Old December 29th, 2006, 03:29 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 1,164
Default not in list open a form

"winty03" wrote in message
ups.com
Your right I didn't see that word wrap, but the DoCmd.OpenForm line is
still red and erroring..I have this code.

DoCmd.OpenForm "frmRequestingAgency", , , , acFormAdd,
acDialog,
NewData


Again, the only error I can see in it is that it should all be on one
line, with no line breaks. Is it broken onto multiple lines in your
original code? Any statement that is going to be broken onto multiple
lines needs to use a line-continuation character at the end of each
broken line.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #13  
Old December 29th, 2006, 04:19 PM posted to microsoft.public.access.forms
winty03
external usenet poster
 
Posts: 12
Default not in list open a form

got it, ya damn word wrap was getting me..sorry about that! thanks for
the help!

  #14  
Old December 29th, 2006, 04:25 PM posted to microsoft.public.access.forms
winty03
external usenet poster
 
Posts: 12
Default not in list open a form

Is the code suppose to close the entire form? I thought when you
clicked no that it would bring you back to your form where you entered
the data and beable to correct say a mistype. Now when I click close
it sends back out of the form I was enter data into.

  #15  
Old December 29th, 2006, 04:35 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 1,164
Default not in list open a form

"winty03" wrote in message
ps.com
Is the code suppose to close the entire form? I thought when you
clicked no that it would bring you back to your form where you entered
the data and beable to correct say a mistype. Now when I click close
it sends back out of the form I was enter data into.


That's what that code says to do:

Else
Me!Service = Me!Service.OldValue
DoCmd.Close


That doesn't make sense to me, but that's what you had written. If you
don't want to close the form, remove the line ...

DoCmd.Close


.... from the Else clause.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #16  
Old December 29th, 2006, 04:53 PM posted to microsoft.public.access.forms
winty03
external usenet poster
 
Posts: 12
Default not in list open a form

perfect thanks! the code I was using before this was giving me the
form even if i clicked no to adding it. working perfect thanks! dirk

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.