RE: Cbo Update Problems
- From: "Bryan" <Bryan@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 16 Dec 2005 09:06:02 -0800
All,
I still need some help in understanding the Responses. I am not sure if the
problem I am experiencing is caused by this or not. Basically, it will not
take no for an answer. I get "The action or method requires a Form Name
argument." when deciding not to add the part. I still cannot get the Else
statement to work and have tried and tried. I've been through all of the
help and cannot find anything wrong with my code, but it insists that I can't
have my Else without an If. I have no idea where it wants me to stick
another If and don't see another one in any example. Any ideas?
"Bryan" wrote:
> Gary,
>
> I just got to insert your Close code and it worked perfectly! Thanks! I
> still need to solve the "Else" issue and understand the two responses in the
> NotInList event code and I'll be in hog heaven!
> Thanks again!
>
> "Bryan" wrote:
>
> > Gary,
> >
> > Thanks for the reply. My code was identical to yours with the exception
> > that I inadvertently typed acDataErrAdd instead of Added in my post. I had
> > it correct in my code, yet it kept telling me that the Else was wrong. Then
> > it balked at the End If. I'll try your close event shortly.
> >
> >
> > "Gary" wrote:
> >
> > > Bryan,
> > >
> > > I had the same problem and finally found the answer by searching the posts.
> > >
> > > I placed this code in the On Not In List event of the control:
> > >
> > > Dim strMessage As String
> > > Dim strFormName As String
> > > strMessage = "The name '" & UCase$(NewData) & "' is not in the list.
> > > " _
> > > & vbCrLf & "Would you like to add the name and phone number?"
> > > If MsgBox(strMessage, vbYesNo + vbQuestion, "Add New Name") = vbYes
> > > Then
> > > strFormName = "NewReqByFrm"
> > > DoCmd.OpenForm strFormName, acNormal, , , acFormAdd, acDialog
> > > UCase$ (NewData)
> > > Response = acDataErrAdded
> > > Else
> > > Response = acDataErrDisplay
> > > End If
> > >
> > > I think I am where you are in understanding code but I was able to replace
> > > the example names with my field names and it works. This gives a custom
> > > message saying the newdata is not in the list, do I want to add it. Since I
> > > need to add a couple of fields, it opens a form to do so.
> > >
> > > After I enter the new data, on my close buttons On Click event I placed:
> > >
> > > DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
> > > DoCmd.CLOSE
> > >
> > >
> > > This seems to refresh the data and it shows immediately in the list upon
> > > return to the original form.
> > >
> > > Those wiser than me can say if I have it right or if there is a better/more
> > > efficient way of doing this. I was just glad it worked.
> > >
> > > hth
> > >
> > > Gary
.
- Follow-Ups:
- RE: Cbo Update Problems
- From: Bryan
- RE: Cbo Update Problems
- References:
- RE: Cbo Update Problems
- From: Gary
- RE: Cbo Update Problems
- From: Bryan
- RE: Cbo Update Problems
- Prev by Date: Re: sort is disabled in calculated column
- Next by Date: Re: Many Tables and Tabs on one form all linked, need help.
- Previous by thread: RE: Cbo Update Problems
- Next by thread: RE: Cbo Update Problems
- Index(es):