"save" button not requerying as coded

Using Access 2007

I have a form (frmNewFamily) that is opened when a NotInList event is 
triggered from a subform in a different form 
(frmAttendance/sfrAttendee).  I have a "Save" button on the frmNewFamily 
that will save the record, close the frmNewFamily and requery the combo 
boxes on sfrAttendee.

I have it working just great, but I want to delete one of the combo 
boxes.  But as soon as I comment out the requery line, the Save button 
stops functioning properly.  It will save the record to the table, but 
not close the form or requery the combo box.  The same thing happens if 
I switch the two requery lines without commenting it out.

sfrAttendee has two combo boxes - CombinedName_cbo (which I want to 
remove) and LastName_cbo, along with the control AtIndID, all of which 
use the AtIndId as the Control Source.  The combo boxes have different 
Row Sources.

I've posted the code for the save button below.  Can someone tell me why 
how to delete the row in my code and the combo box without it causing my 
save button to stop working?  And, hopefully explain to me why it is 
exhibiting this behavior.  I'm trying to learn from my mistakes, but 
this one has me stumped.  :-(

Kathy R.


Private Sub SaveRec_cmd_Click()

On Error GoTo SaveRec_cmd_err

If IsNull(Me!sfrNewIndividual.Form.IndID) Then
MsgBox "Please place your cursor in the ""First Name"" field" & Chr$(13) & _
"of the individual you wish to add to the attendance form." _
, vbOKOnly, "CHOOSE SOMEONE!"
GoTo exit_sub:
End If

'saves new record
DoCmd.RunCommand acCmdSaveRecord

'commenting out the CombinedName_cbo.Requery line or switching
'the CombinedName line with the LastName line causes
'the Save button to save the record, but not requery the subform.
Forms!frmAttendance!sfrAttendee.Form.CombinedName_cbo.Requery
Forms!frmAttendance!sfrAttendee.Form.LastName_cbo.Requery
Forms!frmAttendance!MemberList_lst.Requery

'fills in the new info on sfrAttendee
Forms!frmAttendance!sfrAttendee.Form.AtIndID = 
Forms!frmNewFamily.sfrNewIndividual.Form.IndID

'closes frmNewFamily
DoCmd.Close

SaveRec_cmd_err:
     Dim Msg As String
     Msg = "Error Number " & Err.Number & ": " & Err.Description


exit_sub:


End Sub



0
Kathy
12/27/2009 4:24:58 PM
access.formscoding 7493 articles. 0 followers. Follow

7 Replies
835 Views

Similar Articles

[PageSpeed] 41

It is not necessary to do that Requery. Show us the code you are using to
open the 2nd form.

Kathy R. wrote:
>Using Access 2007
>
>I have a form (frmNewFamily) that is opened when a NotInList event is 
>triggered from a subform in a different form 
>(frmAttendance/sfrAttendee).  I have a "Save" button on the frmNewFamily 
>that will save the record, close the frmNewFamily and requery the combo 
>boxes on sfrAttendee.
>
>I have it working just great, but I want to delete one of the combo 
>boxes.  But as soon as I comment out the requery line, the Save button 
>stops functioning properly.  It will save the record to the table, but 
>not close the form or requery the combo box.  The same thing happens if 
>I switch the two requery lines without commenting it out.
>
>sfrAttendee has two combo boxes - CombinedName_cbo (which I want to 
>remove) and LastName_cbo, along with the control AtIndID, all of which 
>use the AtIndId as the Control Source.  The combo boxes have different 
>Row Sources.
>
>I've posted the code for the save button below.  Can someone tell me why 
>how to delete the row in my code and the combo box without it causing my 
>save button to stop working?  And, hopefully explain to me why it is 
>exhibiting this behavior.  I'm trying to learn from my mistakes, but 
>this one has me stumped.  :-(
>
>Kathy R.
>
>Private Sub SaveRec_cmd_Click()
>
>On Error GoTo SaveRec_cmd_err
>
>If IsNull(Me!sfrNewIndividual.Form.IndID) Then
>MsgBox "Please place your cursor in the ""First Name"" field" & Chr$(13) & _
>"of the individual you wish to add to the attendance form." _
>, vbOKOnly, "CHOOSE SOMEONE!"
>GoTo exit_sub:
>End If
>
>'saves new record
>DoCmd.RunCommand acCmdSaveRecord
>
>'commenting out the CombinedName_cbo.Requery line or switching
>'the CombinedName line with the LastName line causes
>'the Save button to save the record, but not requery the subform.
>Forms!frmAttendance!sfrAttendee.Form.CombinedName_cbo.Requery
>Forms!frmAttendance!sfrAttendee.Form.LastName_cbo.Requery
>Forms!frmAttendance!MemberList_lst.Requery
>
>'fills in the new info on sfrAttendee
>Forms!frmAttendance!sfrAttendee.Form.AtIndID = 
>Forms!frmNewFamily.sfrNewIndividual.Form.IndID
>
>'closes frmNewFamily
>DoCmd.Close
>
>SaveRec_cmd_err:
>     Dim Msg As String
>     Msg = "Error Number " & Err.Number & ": " & Err.Description
>
>exit_sub:
>
>End Sub

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
ruralguy
12/28/2009 3:48:33 AM
Hi Ruralguy.  Thank you for responding.  Could you clarify your question 
please?  I'm a bit confused.  It's not necessary to do which requery, 
the one on the CombinedName_cbo or the one on the LastName_cbo?  I 
realize that it's not necessary to requery the CombinedName_cbo, 
especially since I want to delete that control.  But that's where my 
problem lies.  As soon as I delete (or comment out) that requery, the 
"save" command button stops working as stated below.

Here's the code I use to open the frmNewFamily from the NotInList event 
of the LastName_cbo control on the frmAttendance/sfrAttendee

Private Sub LastName_cbo_NotInList(newdata As String, Response As Integer)
'original code from 
www.blueclaw-db.com/access_notinlist_advanced_example.htm

On Error GoTo LastName_cbo_NotInList_err

Response = acDataErrContinue
Dim ans As Variant

ans = MsgBox(newdata & " is not in the database." & Chr$(13) & _
"Would you like to add this PERSON?", _
vbYesNo, "Add New Individual")

If ans = vbNo Then
     Me!sfrAttendee.Form.LastName_cbo = Null
     DoCmd.GoToControl "LastName_cbo"
     GoTo exit_sub
End If

' add ATTENDEE to NewFamily form
DoCmd.OpenForm ("frmNewFamily")
DoCmd.GoToRecord , , acNewRec
Form_frmNewFamily.FamLastName = newdata

'Me.LastName_cbo = Null   ==> this line was in the original code from 
Blue Claw, NotInList sample
'it gave me the error "You tried to assign a null value to a value that 
is not a Variant type"
'I replaced it with the line "DoCmd.GoToRecord,,acNewRec" above

DoCmd.GoToControl "Street"

LastName_cbo_NotInList_err:
     Dim Msg As String
     Msg = "Error Number " & Err.Number & ": " & Err.Description


exit_sub:

End Sub


ruralguy via AccessMonster.com wrote:
> It is not necessary to do that Requery. Show us the code you are using to
> open the 2nd form.
> 
> Kathy R. wrote:
>> Using Access 2007
>>
>> I have a form (frmNewFamily) that is opened when a NotInList event is 
>> triggered from a subform in a different form 
>> (frmAttendance/sfrAttendee).  I have a "Save" button on the frmNewFamily 
>> that will save the record, close the frmNewFamily and requery the combo 
>> boxes on sfrAttendee.
>>
>> I have it working just great, but I want to delete one of the combo 
>> boxes.  But as soon as I comment out the requery line, the Save button 
>> stops functioning properly.  It will save the record to the table, but 
>> not close the form or requery the combo box.  The same thing happens if 
>> I switch the two requery lines without commenting it out.
>>
>> sfrAttendee has two combo boxes - CombinedName_cbo (which I want to 
>> remove) and LastName_cbo, along with the control AtIndID, all of which 
>> use the AtIndId as the Control Source.  The combo boxes have different 
>> Row Sources.
>>
>> I've posted the code for the save button below.  Can someone tell me why 
>> how to delete the row in my code and the combo box without it causing my 
>> save button to stop working?  And, hopefully explain to me why it is 
>> exhibiting this behavior.  I'm trying to learn from my mistakes, but 
>> this one has me stumped.  :-(
>>
>> Kathy R.
>>
>> Private Sub SaveRec_cmd_Click()
>>
>> On Error GoTo SaveRec_cmd_err
>>
>> If IsNull(Me!sfrNewIndividual.Form.IndID) Then
>> MsgBox "Please place your cursor in the ""First Name"" field" & Chr$(13) & _
>> "of the individual you wish to add to the attendance form." _
>> , vbOKOnly, "CHOOSE SOMEONE!"
>> GoTo exit_sub:
>> End If
>>
>> 'saves new record
>> DoCmd.RunCommand acCmdSaveRecord
>>
>> 'commenting out the CombinedName_cbo.Requery line or switching
>> 'the CombinedName line with the LastName line causes
>> 'the Save button to save the record, but not requery the subform.
>> Forms!frmAttendance!sfrAttendee.Form.CombinedName_cbo.Requery
>> Forms!frmAttendance!sfrAttendee.Form.LastName_cbo.Requery
>> Forms!frmAttendance!MemberList_lst.Requery
>>
>> 'fills in the new info on sfrAttendee
>> Forms!frmAttendance!sfrAttendee.Form.AtIndID = 
>> Forms!frmNewFamily.sfrNewIndividual.Form.IndID
>>
>> 'closes frmNewFamily
>> DoCmd.Close
>>
>> SaveRec_cmd_err:
>>     Dim Msg As String
>>     Msg = "Error Number " & Err.Number & ": " & Err.Description
>>
>> exit_sub:
>>
>> End Sub
> 
0
Kathy
12/28/2009 5:03:28 PM
Hi Kathy,

This is more what I use for a NotInList event:


Private Sub LastName_cbo_NotInList(NewData As String, Response As Integer)
'original code from
www.blueclaw-db.com/access_notinlist_advanced_example.htm

   On Error GoTo LastName_cbo_NotInList_err

   If MsgBox(NewData & " is not in the database." & Chr$(13) & _
             "Would you like to add this PERSON?", _
             vbYesNo, "Add New Individual") = vbNo Then

      Me.LastName_cbo.Undo
      Response = acDataErrContinue
      'DoCmd.GoToControl "LastName_cbo"      '-- I would not attempte to go
to another control in this event!
      GoTo exit_sub
   Else
      ' add ATTENDEE to NewFamily form
      '-- By using the acDialog argument, this code stops until the next form
is closed or made invisible.
      DoCmd.OpenForm "frmNewFamily", , , , acFormAdd, acDialog, NewData

      '-- The following line of code will Requery this ComboBox
      Response = acDataErrAdded

      '-- This is best done in the OnLoad even of the "frmNewFamily" form
since we now pass the value in OpenArgs
      ' If Not IsNull(Me.OpenArgs) Then
      '    Me.FamLastName = Me.OpenArgs
      ' End If
      ' Form_frmNewFamily.FamLastName = NewData

      'Me.LastName_cbo = Null   ==> this line was in the original code from
Blue Claw, NotInList sample
      'it gave me the error "You tried to assign a null value to a value that
is not a Variant type"
      'I replaced it with the line "DoCmd.GoToRecord,,acNewRec" above

      'DoCmd.GoToControl "Street"         '-- I would not attempte to go to
another control in this event!
   End If

LastName_cbo_NotInList_err:
'   Dim Msg As String
   MsgBox "Error Number " & Err.Number & ": " & Err.Description

exit_sub:

End Sub




Kathy R. wrote:
>Hi Ruralguy.  Thank you for responding.  Could you clarify your question 
>please?  I'm a bit confused.  It's not necessary to do which requery, 
>the one on the CombinedName_cbo or the one on the LastName_cbo?  I 
>realize that it's not necessary to requery the CombinedName_cbo, 
>especially since I want to delete that control.  But that's where my 
>problem lies.  As soon as I delete (or comment out) that requery, the 
>"save" command button stops working as stated below.
>
>Here's the code I use to open the frmNewFamily from the NotInList event 
>of the LastName_cbo control on the frmAttendance/sfrAttendee
>
>Private Sub LastName_cbo_NotInList(newdata As String, Response As Integer)
>'original code from 
>www.blueclaw-db.com/access_notinlist_advanced_example.htm
>
>On Error GoTo LastName_cbo_NotInList_err
>
>Response = acDataErrContinue
>Dim ans As Variant
>
>ans = MsgBox(newdata & " is not in the database." & Chr$(13) & _
>"Would you like to add this PERSON?", _
>vbYesNo, "Add New Individual")
>
>If ans = vbNo Then
>     Me!sfrAttendee.Form.LastName_cbo = Null
>     DoCmd.GoToControl "LastName_cbo"
>     GoTo exit_sub
>End If
>
>' add ATTENDEE to NewFamily form
>DoCmd.OpenForm ("frmNewFamily")
>DoCmd.GoToRecord , , acNewRec
>Form_frmNewFamily.FamLastName = newdata
>
>'Me.LastName_cbo = Null   ==> this line was in the original code from 
>Blue Claw, NotInList sample
>'it gave me the error "You tried to assign a null value to a value that 
>is not a Variant type"
>'I replaced it with the line "DoCmd.GoToRecord,,acNewRec" above
>
>DoCmd.GoToControl "Street"
>
>LastName_cbo_NotInList_err:
>     Dim Msg As String
>     Msg = "Error Number " & Err.Number & ": " & Err.Description
>
>exit_sub:
>
>End Sub
>
>> It is not necessary to do that Requery. Show us the code you are using to
>> open the 2nd form.
>[quoted text clipped - 61 lines]
>>>
>>> End Sub

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
ruralguy
12/28/2009 5:45:57 PM
Ruralguy,

I've changed the code as you suggested.  When the NotInList event fires, 
the message box pops up correctly, and the "No" button works correctly. 
But when I click "Yes" the debug window pops up with the message "Field 
‘tblFamily.FamLastName’ cannot be a zero-length string." and the line 
     "Form_frmNewFamily.FamLastName = NewData" is highlighted.

If I click "end" instead of "debug" the frmNewFamily window opens with 
the new last name entered in the appropriate place.  However, I cannot 
navigate to the subform on that form, and if I close via the X in the 
top right-hand corner, I am told that "You can't save this record at 
this time."

On a side note - why would you not navigate to a different control with 
this event?  I'm just curious about your reasoning so that I may learn 
better :-)

Also, how do I reposition the frmNewFamily window when it opens?  I have 
my Windows start bar at the top of my window (Microsoft puts every other 
menu bar at the top of the window...why is the Start bar at the bottom?) 
so the top of the frmNewFamily is tucked under my start bar and is 
inaccessible.

Kathy


ruralguy via AccessMonster.com wrote:
> Hi Kathy,
> 
> This is more what I use for a NotInList event:
> 
> 
> Private Sub LastName_cbo_NotInList(NewData As String, Response As Integer)
> 'original code from
> www.blueclaw-db.com/access_notinlist_advanced_example.htm
> 
>    On Error GoTo LastName_cbo_NotInList_err
> 
>    If MsgBox(NewData & " is not in the database." & Chr$(13) & _
>              "Would you like to add this PERSON?", _
>              vbYesNo, "Add New Individual") = vbNo Then
> 
>       Me.LastName_cbo.Undo
>       Response = acDataErrContinue
>       'DoCmd.GoToControl "LastName_cbo"      '-- I would not attempte to go
> to another control in this event!
>       GoTo exit_sub
>    Else
>       ' add ATTENDEE to NewFamily form
>       '-- By using the acDialog argument, this code stops until the next form
> is closed or made invisible.
>       DoCmd.OpenForm "frmNewFamily", , , , acFormAdd, acDialog, NewData
> 
>       '-- The following line of code will Requery this ComboBox
>       Response = acDataErrAdded
> 
>       '-- This is best done in the OnLoad even of the "frmNewFamily" form
> since we now pass the value in OpenArgs
>       ' If Not IsNull(Me.OpenArgs) Then
>       '    Me.FamLastName = Me.OpenArgs
>       ' End If
>       ' Form_frmNewFamily.FamLastName = NewData
> 
>       'Me.LastName_cbo = Null   ==> this line was in the original code from
> Blue Claw, NotInList sample
>       'it gave me the error "You tried to assign a null value to a value that
> is not a Variant type"
>       'I replaced it with the line "DoCmd.GoToRecord,,acNewRec" above
> 
>       'DoCmd.GoToControl "Street"         '-- I would not attempte to go to
> another control in this event!
>    End If
> 
> LastName_cbo_NotInList_err:
> '   Dim Msg As String
>    MsgBox "Error Number " & Err.Number & ": " & Err.Description
> 
> exit_sub:
> 
> End Sub
> 
> 
> 
> 
> Kathy R. wrote:
>> Hi Ruralguy.  Thank you for responding.  Could you clarify your question 
>> please?  I'm a bit confused.  It's not necessary to do which requery, 
>> the one on the CombinedName_cbo or the one on the LastName_cbo?  I 
>> realize that it's not necessary to requery the CombinedName_cbo, 
>> especially since I want to delete that control.  But that's where my 
>> problem lies.  As soon as I delete (or comment out) that requery, the 
>> "save" command button stops working as stated below.
>>
>> Here's the code I use to open the frmNewFamily from the NotInList event 
>> of the LastName_cbo control on the frmAttendance/sfrAttendee
>>
>> Private Sub LastName_cbo_NotInList(newdata As String, Response As Integer)
>> 'original code from 
>> www.blueclaw-db.com/access_notinlist_advanced_example.htm
>>
>> On Error GoTo LastName_cbo_NotInList_err
>>
>> Response = acDataErrContinue
>> Dim ans As Variant
>>
>> ans = MsgBox(newdata & " is not in the database." & Chr$(13) & _
>> "Would you like to add this PERSON?", _
>> vbYesNo, "Add New Individual")
>>
>> If ans = vbNo Then
>>     Me!sfrAttendee.Form.LastName_cbo = Null
>>     DoCmd.GoToControl "LastName_cbo"
>>     GoTo exit_sub
>> End If
>>
>> ' add ATTENDEE to NewFamily form
>> DoCmd.OpenForm ("frmNewFamily")
>> DoCmd.GoToRecord , , acNewRec
>> Form_frmNewFamily.FamLastName = newdata
>>
>> 'Me.LastName_cbo = Null   ==> this line was in the original code from 
>> Blue Claw, NotInList sample
>> 'it gave me the error "You tried to assign a null value to a value that 
>> is not a Variant type"
>> 'I replaced it with the line "DoCmd.GoToRecord,,acNewRec" above
>>
>> DoCmd.GoToControl "Street"
>>
>> LastName_cbo_NotInList_err:
>>     Dim Msg As String
>>     Msg = "Error Number " & Err.Number & ": " & Err.Description
>>
>> exit_sub:
>>
>> End Sub
>>
>>> It is not necessary to do that Requery. Show us the code you are using to
>>> open the 2nd form.
>> [quoted text clipped - 61 lines]
>>>> End Sub
> 
0
Kathy
12/28/2009 6:48:59 PM
This line:
"Form_frmNewFamily.FamLastName = NewData" is highlighted
...s/b commented out not generate an error.

You need to base your forms on queries of tables rather than directly to
tables. That will avoid the locking problem you are getting.

Kathy R. wrote:
>Ruralguy,
>
>I've changed the code as you suggested.  When the NotInList event fires, 
>the message box pops up correctly, and the "No" button works correctly. 
>But when I click "Yes" the debug window pops up with the message "Field 
>‘tblFamily.FamLastName’ cannot be a zero-length string." and the line 
>     "Form_frmNewFamily.FamLastName = NewData" is highlighted.
>
>If I click "end" instead of "debug" the frmNewFamily window opens with 
>the new last name entered in the appropriate place.  However, I cannot 
>navigate to the subform on that form, and if I close via the X in the 
>top right-hand corner, I am told that "You can't save this record at 
>this time."
>
>On a side note - why would you not navigate to a different control with 
>this event?  I'm just curious about your reasoning so that I may learn 
>better :-)
>
>Also, how do I reposition the frmNewFamily window when it opens?  I have 
>my Windows start bar at the top of my window (Microsoft puts every other 
>menu bar at the top of the window...why is the Start bar at the bottom?) 
>so the top of the frmNewFamily is tucked under my start bar and is 
>inaccessible.
>
>Kathy
>
>> Hi Kathy,
>> 
>[quoted text clipped - 104 lines]
>>> [quoted text clipped - 61 lines]
>>>>> End Sub

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
ruralguy
12/28/2009 7:00:41 PM
Okay, I removed that line, I see where I made that mistake.  By the way 
the record sources for both main forms are queries and both subforms are 
SQL statements, none of them are based directly on the tables.

Unfortunately, I'm on to a new error, but I think I see what the problem 
is.  Once I add a new FamLastName to the frmNewFamily, and click close, 
I get an error window with "Error Number 0:"  Is this because I 
shouldn't use

On Error GoTo LastName_cbo_NotInList_err
and
LastName_cbo_NotInList_err:
    MsgBox "Error Number " & Err.Number & ": " & Err.Description

in conjunction with acDataErrContinue or acDataErrAdded?

I'm sorry if I'm being particularly dense (I'm certainly feeling that 
way at the moment!), but Error 0 isn't giving me anything to go on.  I 
really appreciate your help and patience!


ruralguy via AccessMonster.com wrote:
> This line:
> "Form_frmNewFamily.FamLastName = NewData" is highlighted
> ..s/b commented out not generate an error.
> 
> You need to base your forms on queries of tables rather than directly to
> tables. That will avoid the locking problem you are getting.
> 
> Kathy R. wrote:
>> Ruralguy,
>>
>> I've changed the code as you suggested.  When the NotInList event fires, 
>> the message box pops up correctly, and the "No" button works correctly. 
>> But when I click "Yes" the debug window pops up with the message "Field 
>> ‘tblFamily.FamLastName’ cannot be a zero-length string." and the line 
>>     "Form_frmNewFamily.FamLastName = NewData" is highlighted.
>>
>> If I click "end" instead of "debug" the frmNewFamily window opens with 
>> the new last name entered in the appropriate place.  However, I cannot 
>> navigate to the subform on that form, and if I close via the X in the 
>> top right-hand corner, I am told that "You can't save this record at 
>> this time."
>>
>> On a side note - why would you not navigate to a different control with 
>> this event?  I'm just curious about your reasoning so that I may learn 
>> better :-)
>>
>> Also, how do I reposition the frmNewFamily window when it opens?  I have 
>> my Windows start bar at the top of my window (Microsoft puts every other 
>> menu bar at the top of the window...why is the Start bar at the bottom?) 
>> so the top of the frmNewFamily is tucked under my start bar and is 
>> inaccessible.
>>
>> Kathy
>>
>>> Hi Kathy,
>>>
>> [quoted text clipped - 104 lines]
>>>> [quoted text clipped - 61 lines]
>>>>>> End Sub
> 
0
Kathy
12/28/2009 9:06:05 PM
My bad. That's air code for you. Add the Exit sub above the Error routine.

Exit Sub
LastName_cbo_NotInList_err:

Error 0 is *no* error and the code was falling through the error routine.

Kathy R. wrote:
>Okay, I removed that line, I see where I made that mistake.  By the way 
>the record sources for both main forms are queries and both subforms are 
>SQL statements, none of them are based directly on the tables.
>
>Unfortunately, I'm on to a new error, but I think I see what the problem 
>is.  Once I add a new FamLastName to the frmNewFamily, and click close, 
>I get an error window with "Error Number 0:"  Is this because I 
>shouldn't use
>
>On Error GoTo LastName_cbo_NotInList_err
>and
>LastName_cbo_NotInList_err:
>    MsgBox "Error Number " & Err.Number & ": " & Err.Description
>
>in conjunction with acDataErrContinue or acDataErrAdded?
>
>I'm sorry if I'm being particularly dense (I'm certainly feeling that 
>way at the moment!), but Error 0 isn't giving me anything to go on.  I 
>really appreciate your help and patience!
>
>> This line:
>> "Form_frmNewFamily.FamLastName = NewData" is highlighted
>[quoted text clipped - 34 lines]
>>>>> [quoted text clipped - 61 lines]
>>>>>>> End Sub

-- 
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200912/1

0
ruralguy
12/28/2009 11:00:11 PM
Reply:

Similar Artilces:

FileNotFound returned by Bitmap::Save() when saving to stream
I have a little chunk of code which is supposed to take a bitmap image and save its PNG encoding into a block of memory. The problem is, I keep getting a FileNotFound error back from Save(). If anyone has any ideas, I'd love to hear them. Here's the code (more or less) in question; there really shouldn't be much to it, I would have thought: /* Allocate an IStream object to write the data into a global memory block. We indicate that the handle to the underlying data will be freed when the stream object is released. */ VERIFY(S_OK == ::CreateStreamOnHGlobal(nil, True, static_c...

Unable to save password in Outlook 2003
I cannot seem to save my "network password" for Outlook 2003. I tried everything I can think of. I tried editing the registry. I use XP. I try going into Control Panel, go to mail and go thru the process there and....nothing worked there. I uninstalled Office the reinstalled it.....nothing! I even went as far as unistalling my internet software, still...nothing! Someone told me that XP will not save passwords. My Outlook express works fine. Someone HELP! I also had this issue in Outlook 2003, but also in indows Live Messenger and Internet Explorer 7. I spend hour...

what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document?
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel wrote: > what encoding does system.xml.xmldocument.save(string path) use to save the > xml document if there is no <?xml... in the front of the xml document? UTF-8 is the default encoding. -- Oleg Tkachenko [XML MVP, MCPD] http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net utf8 i suppose would be default Vinu Baby "Daniel" <softwareengineer98037@yahoo.com> wrote in message news:e8#...

Save and save as
Hi, I am looking for some help with a macro, I need to disable anyone from saving a file or save as and also disable the prompt if the close button is pressed you get an option to save the file then, I need to disable all of these, also have a pop up box to warn that save as been disables when a user tries to save the file fro save and save as. Can anyone help me with this. I am using word 2003 Regards Mark Once you give someone access to a document, you have ceded all control over it. You can however stop them from overwriting the original file by making the doc...

Save to unProtect a Document?
Our company has word documents that we use as templates on a fileserver. How could I protect the documents so that when they open them, they dont make changes to the server version, but save their OWN version and do what they want? First of all, make use of true *template* files (with the *.dot or *.dotx extension). Also, assign the template files the read-ony attribute. -- Stefan Blom Microsoft Word MVP "Chris" <Chris@discussions.microsoft.com> wrote in message news:EB9D352D-823F-4126-8A00-2D90516A3FA1@microsoft.com... > Our company has word docum...

Save csv format to dbf format
I have a .csv file with 13 columns of data opened in excel. I make a few changes to a field and then want to save to .dbf format. After saving as .dbf when I open the file only column 1 data is present. Any insights into where the rest of the data goes? Why does the data disappear? Thanks, Mike -- mdelasaux ------------------------------------------------------------------------ mdelasaux's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28889 View this thread: http://www.excelforum.com/showthread.php?threadid=486365 Try using Notepad and open your .dbf...

when I save an email, where does it save to?
Hi all, I have several emails that I wanted to reply, and I did click "reply" and then wrote something, but I did not have time to finish... then I click on "save", and in the evening, I closed the outlook because I slept... now I reopen the outlook in the morning, and I want to find my saved unfinished replies that I was writing... But where to find them? I have a "draft" folder, but those saved emails do not seem to be in this folder... wherelse could they go? ---------------------------------------------- This is annoying... is there a way to automat...

Automatic save of all messages from a known contact
Hi, I'd like to store automatically all messages from a known CRM Contact. If for example my customers email-address is somebody@somhow.com, I'd like to store automatically all his emails via the Exchange<->CRM Connector regardless to who they are sent to. Is that possible? regards Juergen Tolksdorf Hi Juergen. My company has a product called Effective Email that does exactly what you are asking for. There is a sync event that gets installed on the users inbox. When emails come in, it checks the senders address against the CRM database, and if a match exists, it creates a...

How to get saved old saved work that was saved over?
I typed up some History notes and saved it. I wanted to use the same format from those History notes for some new History notes and I saved over on my old work. How can i retrive my old saved work? My work was in Word not Excel But I could not find a place to ask a question in the Word help section. If you saved over the original file, it is gone forever. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Maral" <Maral@discussions.microsoft.com> wrote in message news:C0ADFEF9-6A46-4589-8923-4BFC07D9C61F@microsoft.com......

auto save email address's
In outlook 2007, how do I set it to auto save email address's that I send out? No full versions of Outlook ever had the ability to add recipients automatically to your Contacts Folder. Only the long abandoned IMO mode of Outlook 98/2000 did that. To automatically add the email address of people you respond to to your Contacts Folder requires code: http://www.outlookcode.com/d/code/autoaddrecip.htm http://www.slipstick.com/contacts/addauto.htm -- Russ Valentine [MVP-Outlook] "Johnfli" <john@ivhs.us> wrote in message news:%23t7Bb82DIHA.1164@TK2MSFTNGP02.phx.gbl... &g...

Save All...
Excel 2002 SP3 Win XP Pro SP2 Hi, Is there a way to do a Save All (all opened files) in a similar fashion as clicking Shift|File|Close All ? Failing that, any macros out there I could use? Thanks a million! Here is one I use to save and close all opened files including the file housing the macro and leaving excel. Sub CLOSE_ALL() Application.ScreenUpdating = False Application.DisplayAlerts = False For Each w In Application.Workbooks If w.Name <> ThisWorkbook.Name Then w.Save w.Close ' w.Close SaveChanges:=True 'MsgBox w.Name End If Next w ThisWorkbook.Save Applicati...

cannot save
This is a multi-part message in MIME format. ------=_NextPart_000_002C_01C95C58.03E0EE80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable All of a sudden I can no longer save Excel 2007 files. It crashes and = tells me that I need to download an update. When I try to update I get = error number:0x8DDD0002. This is new. Help? --=20 Rick Wolfe Malaspina Coach Lines ------=_NextPart_000_002C_01C95C58.03E0EE80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-...

Save password under send/recive action
I have 3 email acounts. En when checking for new mail, the send recive box apears, and want me to chose outlook to remenber my password. I chose yes, but i get the same question everytime under send/recive. Outlook wont remember my password to my email acounts allthough i choose it to do so.... I have outlook 2002 and win. XP PLEASE HELT ANYONE !!! Thanx.. ...

Save As versus Save
I've created a spreadsheet that I need to make accessible to our managers. They will need to open the form fill it in and save the new form with their information. How do I force them to use the "Save As" command versus the "Save"? "Sara" <Sara@discussions.microsoft.com> wrote in message news:F4C8BDF0-17D1-4341-AD36-FF5CC9C7B36C@microsoft.com... > I've created a spreadsheet that I need to make accessible to our managers. > They will need to open the form fill it in and save the new form with > their > information. How do I force ...

Publisher: How do I save to CD-RW without it deafulting to Read-O.
I am having difficulty saving to CD-RW's without it defaulting to Read-Only after it had been saved to the disc. Any suggestions? Mike321123 <Mike321123@discussions.microsoft.com> was very recently heard to utter: > I am having difficulty saving to CD-RW's without it defaulting to > Read-Only after it had been saved to the disc. Any suggestions? CD-RW discs are not designed to be used as removeable hard drives or even large floppy disks. You will need to save to your local drive and copy to the CD-RW using your CD-writing software. Then, when you wish to edit the f...

Where are config settings saved for scale out of RS
Hello all; This one has been eluding me for several days now. We are moving our servers and transfering both SQL Databases and services. When we try to configure RS on the new machine, connected to the newly restored DB, it sees it as a scale out deployment even though we are running SQL Standard edition which does not allow scale out. I am looking for WHERE RS might store the info for scale out settings. I have searched the config XML files, ini files, Registry Settings and the ReportServer database itself and found no references to scale out. Does anybody know where these ...

VB Save
I have a activeworkbook.save in my code after a command button is pressed but as far as I can tell it doesn't actually perform the save until I close my forms...Is this normal? All I want is sheet one to be saved every time the "job end" button is pushed so that if the pc crashes all the data is up-to-date when I reboot... Craig... -- The Zero ST Craig, It should save the workbook when the code is executed. Maybe you should ensure the code is in fact being executed. Maybe a breakpoint (F9) on the line. -- Earl Kiosterud www.smokeylake.com Note: Some folks prefer bottom-...

save record on continuous form
Can you force a save record at a certain control, to force a requery to a linkfield at that point? Anne wrote: >Can you force a save record at a certain control, to force a requery to a >linkfield at that point? I don't understand what you mean by "force a requery to a linkfield", but you can force a record to be saved (as long as it passes its intefrity checks) at any tine by using a line of code: If Me.Dirty Then Me.Dirty = False -- Marsh MVP [MS Access] ...

Limited to save or not save messages?
With Outlook 2003, I wonder if there is a way to prompt whether one wants to save an email before sending? I don't want to save every email I send, but if I uncheck that setting (save to sent items), I will inevitably forget to manually save a key email at some point. My corporate Lotus Notes has this setting, surely it is somewhere within Outlook? Thanks for the direction, Howie ---------- --Howie No, you will need to do it manually. --=81 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account wi...

Data Save error
GP Ver 6.0. Recently I am facing an error with normal users unable to save records, where as the system administrator is able to save the same information. Please advice on this error, what has to be done. I have disabled the windows user ID of the Database owner. Thinking of this made Dynasa as the DBO. Database is having enough free space available. Hi How big is the company database? Is it over 10GB? Regards James "Matthews" <Matthews@discussions.microsoft.com> wrote in message news:3FF3F553-5B18-4D8A-B65E-8A253BF94BB2@microsoft.com... > GP Ver 6.0. Recently I...

Unable to load saved file
We recently had our laptop stolen. I have a copy of the MS Money file take a few days before hand. The Version being used is Ver 14.0.120.805 2004. When I try to load the copied file onto our new computer I am getting the following message. " Money cannot locate [file name] or cannot open it, possibly because it is a read-only file or you do not have permission to change it or your disk is write protected. If you have chosen the correct file and it cannot be accessed, you will need to click OK and open your most recent backup file. If the file is being used by another application...

Unexpected 'Save Changes in Book1' prompt
Running Office 2000 Whenever I exit a workbook I now get the following prompt: 'do you want to save the changes you made to Book 1' I've repaired my Office installation, but this had no effect. Any ideas? There are some worksheet functions that are volatile--that are recalculated when excel recalcs. AREAS() CELL() INDIRECT() ROWS() COLUMNS() NOW() TODAY() RAND() Any of these functions in formulas could make excel think your workbook has changed. Glynn Taylor wrote: > > Running Office 2000 > > Whenever I exit a w...

File I'm modifying works as long as I don't close it; Saved copies crash and burn when opened
I have an Excel problem that arises from a complicated chain of events. Every time I get past a certain point in my current Excel template construction, any file saved after that will not open without crashing and destroying itself, even though the file I am working in appears to be just fine and I can continue modifying it, loading data and running macros and what-not, and saving as new filenames...as long as I don't close it. Once I close it, it too will not open, and I have to revert to the last saved version before that point in the construction of the file just to get the file to op...

Save AS Web Page
Outlook 2003 Pro Windows XP Pro I can save the calendar as a web page, I would like to know if it's possible to do this automatically? i.e. when shutting down Outlook I have a small network with a intranet web site and want to publish the calendar to the web site, I can do this successfully with excel and hope it can be done with Outlook Thanks :o) Not natively - you probably can using some programming set to run on shutdown. Post in one of the programming groups for Outlook and you have a better chance of getting an authoritative answer. --� Milly Staples [MVP - Outlook] Po...

Intercepting the Save
This is a multi-part message in MIME format. ------=_NextPart_000_001F_01CA6D38.8B1A8E50 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit I want to run a little code when the user saves the workbook. How can I intercept the Save command? Dennis ------=_NextPart_000_001F_01CA6D38.8B1A8E50 Content-Type: text/x-vcard; name="dennis13030@cox.net.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dennis13030@cox.net.vcf" BEGIN:VC...