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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Change VB Code to Close
I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#2
|
|||
|
|||
Change VB Code to Close
if what you said is what you meant -- the FORM will not save...
'~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then DoCmd.Close acForm, Me.Name, acSaveNo else DoCmd.Close acForm, Me.Name, acSaveYes end if '~~~~~~~~~~~~~~~ if what you meant is that the RECORD will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then if me.dirty then me.undo end if end if DoCmd.Close acForm, Me.Name '~~~~~~~~~~~~~~~ Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#3
|
|||
|
|||
Change VB Code to Close
Keep getting a compile error after Me.
The combo box is in SubHorseDetails on the form does that make a difference....Thanx Bob "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... if what you said is what you meant -- the FORM will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then DoCmd.Close acForm, Me.Name, acSaveNo else DoCmd.Close acForm, Me.Name, acSaveYes end if '~~~~~~~~~~~~~~~ if what you meant is that the RECORD will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then if me.dirty then me.undo end if end if DoCmd.Close acForm, Me.Name '~~~~~~~~~~~~~~~ Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#4
|
|||
|
|||
Change VB Code to Close
Compile error
Method or data member not found! "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... if what you said is what you meant -- the FORM will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then DoCmd.Close acForm, Me.Name, acSaveNo else DoCmd.Close acForm, Me.Name, acSaveYes end if '~~~~~~~~~~~~~~~ if what you meant is that the RECORD will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then if me.dirty then me.undo end if end if DoCmd.Close acForm, Me.Name '~~~~~~~~~~~~~~~ Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#5
|
|||
|
|||
Change VB Code to Close
Hi Bob,
"The combo box is in SubHorseDetails on the form does that make a difference...." yes! if isnull(me.SubHorseDetails.form.OwnerInfo) then Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: Keep getting a compile error after Me. The combo box is in SubHorseDetails on the form does that make a difference....Thanx Bob "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... if what you said is what you meant -- the FORM will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then DoCmd.Close acForm, Me.Name, acSaveNo else DoCmd.Close acForm, Me.Name, acSaveYes end if '~~~~~~~~~~~~~~~ if what you meant is that the RECORD will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then if me.dirty then me.undo end if end if DoCmd.Close acForm, Me.Name '~~~~~~~~~~~~~~~ Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#6
|
|||
|
|||
Change VB Code to Close
I must be stupid, I am still getting a compile error after Me.
Thanx bob "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... Hi Bob, "The combo box is in SubHorseDetails on the form does that make a difference...." yes! if isnull(me.SubHorseDetails.form.OwnerInfo) then Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: Keep getting a compile error after Me. The combo box is in SubHorseDetails on the form does that make a difference....Thanx Bob "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... if what you said is what you meant -- the FORM will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then DoCmd.Close acForm, Me.Name, acSaveNo else DoCmd.Close acForm, Me.Name, acSaveYes end if '~~~~~~~~~~~~~~~ if what you meant is that the RECORD will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then if me.dirty then me.undo end if end if DoCmd.Close acForm, Me.Name '~~~~~~~~~~~~~~~ Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#7
|
|||
|
|||
Change VB Code to Close -- use Name property to refer to controls
Hi Bob,
After "Me.", you must use the NAME property for the subform control, not the SourceObject property. After that, you must have ".form" to specify your want a control on the subform as opposed to the container itself, then, again, you must use the NAME property of the OwnerInfo control, not the ControlSource property Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I must be stupid, I am still getting a compile error after Me. Thanx bob "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... Hi Bob, "The combo box is in SubHorseDetails on the form does that make a difference...." yes! if isnull(me.SubHorseDetails.form.OwnerInfo) then Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: Keep getting a compile error after Me. The combo box is in SubHorseDetails on the form does that make a difference....Thanx Bob "strive4peace" "strive4peace2006 at yahoo dot com" wrote in message ... if what you said is what you meant -- the FORM will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then DoCmd.Close acForm, Me.Name, acSaveNo else DoCmd.Close acForm, Me.Name, acSaveYes end if '~~~~~~~~~~~~~~~ if what you meant is that the RECORD will not save... '~~~~~~~~~~~~~~~~` if isnull(me.OwnerInfo) then if me.dirty then me.undo end if end if DoCmd.Close acForm, Me.Name '~~~~~~~~~~~~~~~ Warm Regards, Crystal Microsoft Access MVP 2006 * Have an awesome day remote programming and training strive4peace2006 at yahoo.com * Bob wrote: I want to change this code slightly so if there is no data in The combo Box OwnerInfo that the form will not save on closing Private Sub cmdClose_Click() If Me.OpenArgs = "ActiveHorses" Then Me.Requery Forms!frmActiveHorses.Visible = True Forms!frmActiveHorses!cbHorseName.Requery End If subSetValues DoCmd.Close acForm, Me.Name End Sub Thanks in advance.........Bob Vance |
#8
|
|||
|
|||
Change VB Code to Close -- use Name property to refer to controls
Thanks Crystal for your help, Got it
Private Sub cmdClose_Click() If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Then If Me.Dirty Then Me.Undo End If End If DoCmd.Close acForm, Me.Name End |
#9
|
|||
|
|||
Change VB Code to Close -- use Name property to refer to controls
Crystal can it be change so if there is nothing in OwnerID it will not
close! Regards Bob "Bob" wrote in message ... Thanks Crystal for your help, Got it Private Sub cmdClose_Click() If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Then If Me.Dirty Then Me.Undo End If End If DoCmd.Close acForm, Me.Name End |
#10
|
|||
|
|||
Change VB Code to Close -- use Name property to refer to controls
Sorry Crystal, I mean the from wont close!....Bob
"Bob" wrote in message ... Crystal can it be change so if there is nothing in OwnerID it will not close! Regards Bob "Bob" wrote in message ... Thanks Crystal for your help, Got it Private Sub cmdClose_Click() If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Then If Me.Dirty Then Me.Undo End If End If DoCmd.Close acForm, Me.Name End |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I can receive email but cannot send it. | pegasus | General Discussion | 175 | April 27th, 2010 05:49 PM |
Find the cell value in excel by using vb code | Michael | General Discussion | 5 | June 14th, 2005 01:24 PM |
0x80040109 error when sending from SSL SMTP | krouse | General Discussion | 7 | March 15th, 2005 01:55 AM |
My switchboards won't work with WinXP ! | Jeff Conrad | Using Forms | 4 | February 25th, 2005 08:51 PM |
SMTP Authentication fails | SharpEye | General Discussion | 0 | February 25th, 2005 08:49 AM |