f



Lock a Sub-Form from a Form control

** Any assistance you can provide would be greatly appreciated **

I have a main form with multiple sub-forms. On the main form, I have a
checkbox that corresponds with each sub-form, and this checkbox will
express the users desire to lock the ability to edit a corresponding
sub-form. To do this, I figure that each checkbox will have :
(1) the AfterUpdate property call a Macro or VB Module to execute the
setting of the Allow Edits property of the sub-form and
(2) the On Current or On Load property of each corresponding sub-form
will also check the value of the checkbox in the main form to
determine whether the Allow Edits value for this sub-form should be
Yes or No.

I have a Macro that sets the value for the sub-form and I have plugged
that into the AfterUpdate setting of the checkbox on the main form,
but I cannot find a way to insert a step before the SetValue part
which can evaluate the state of the checkbox and conditionally set the
value of the Allow Edits based on that value. I have also been playing
with the Visual Basic Code Editor my feable attempts are also failing.
Any help or insight you can provide would be helpful.

The VB code I have at the moment (but it is not compiling properly)
is:

Private Sub Locked_AfterUpdate()
 If Forms!Form1!Locked = True Then SetValue [Forms]![SubForm1]![Allow
Edits] = No
 Else: SetValue [Forms]![SubForm1]![Allow Edits] = Yes
 End If
 
End Sub

** If the form element called Locked is checked, then set the form
property Allow Edits of SubForm1 to No, else set value to Yes.

Again, I appreciate any thoughts or help you can provide to either add
to the macro I have to do that evaluation of the form element value,
or adjust the code so it can be used in both the AfterUpdate property
of the checkbox and either the On Current or On Load properties of
each subform.
0
jasong955 (1)
1/23/2004 2:37:32 AM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

2 Replies
533 Views

Similar Articles

[PageSpeed] 35

Private Sub Locked_AfterUpdate()
  [Forms]![SubForm1]!form.AllowEdits = Not(locked)
End Sub


jasong955@hotmail.com (Jason G) wrote in message news:<ae844aa4.0401221837.66a7305b@posting.google.com>...
> ** Any assistance you can provide would be greatly appreciated **
> 
> I have a main form with multiple sub-forms. On the main form, I have a
> checkbox that corresponds with each sub-form, and this checkbox will
> express the users desire to lock the ability to edit a corresponding
> sub-form. To do this, I figure that each checkbox will have :
> (1) the AfterUpdate property call a Macro or VB Module to execute the
> setting of the Allow Edits property of the sub-form and
> (2) the On Current or On Load property of each corresponding sub-form
> will also check the value of the checkbox in the main form to
> determine whether the Allow Edits value for this sub-form should be
> Yes or No.
> 
> I have a Macro that sets the value for the sub-form and I have plugged
> that into the AfterUpdate setting of the checkbox on the main form,
> but I cannot find a way to insert a step before the SetValue part
> which can evaluate the state of the checkbox and conditionally set the
> value of the Allow Edits based on that value. I have also been playing
> with the Visual Basic Code Editor my feable attempts are also failing.
> Any help or insight you can provide would be helpful.
> 
> The VB code I have at the moment (but it is not compiling properly)
> is:
> 
> Private Sub Locked_AfterUpdate()
>  If Forms!Form1!Locked = True Then SetValue [Forms]![SubForm1]![Allow
> Edits] = No
>  Else: SetValue [Forms]![SubForm1]![Allow Edits] = Yes
>  End If
>  
> End Sub
> 
> ** If the form element called Locked is checked, then set the form
> property Allow Edits of SubForm1 to No, else set value to Yes.
> 
> Again, I appreciate any thoughts or help you can provide to either add
> to the macro I have to do that evaluation of the form element value,
> or adjust the code so it can be used in both the AfterUpdate property
> of the checkbox and either the On Current or On Load properties of
> each subform.
0
lesperancer (750)
1/23/2004 4:42:56 PM
When refering to properties you need to use a . and not a !
Also, make the language of the checkbox option correspond to the property it
is affecting. In this case for instance, make the checkbox mean "Form is
UnLocked" and not "Form is Locked". this way you can simply use in the
checkboxes AfterUpdate event...

Me!subformcontrol.Form.AllowEdits = Me!checkbox.

If  it is checked (True) then this sets the property to true and allows
editing, otherwise it will prevent them.

Also, use the OnLoad event of the main form to do the inital locking. In the
same manner.
Controls don't have OnLoad Events.

Your code is not compiling for a number of reasons.I
    It is looking for a Fuction or Sub called SetValue, it won't look at
macros.
    Second, ![AllowEdits] is a property, not a control, so refering to it in
this manner is not allowed.

Hope this makes sense.
Mike Storr
www.veraccess.com



"Jason G" <jasong955@hotmail.com> wrote in message
news:ae844aa4.0401221837.66a7305b@posting.google.com...
> ** Any assistance you can provide would be greatly appreciated **
>
> I have a main form with multiple sub-forms. On the main form, I have a
> checkbox that corresponds with each sub-form, and this checkbox will
> express the users desire to lock the ability to edit a corresponding
> sub-form. To do this, I figure that each checkbox will have :
> (1) the AfterUpdate property call a Macro or VB Module to execute the
> setting of the Allow Edits property of the sub-form and
> (2) the On Current or On Load property of each corresponding sub-form
> will also check the value of the checkbox in the main form to
> determine whether the Allow Edits value for this sub-form should be
> Yes or No.
>
> I have a Macro that sets the value for the sub-form and I have plugged
> that into the AfterUpdate setting of the checkbox on the main form,
> but I cannot find a way to insert a step before the SetValue part
> which can evaluate the state of the checkbox and conditionally set the
> value of the Allow Edits based on that value. I have also been playing
> with the Visual Basic Code Editor my feable attempts are also failing.
> Any help or insight you can provide would be helpful.
>
> The VB code I have at the moment (but it is not compiling properly)
> is:
>
> Private Sub Locked_AfterUpdate()
>  If Forms!Form1!Locked = True Then SetValue [Forms]![SubForm1]![Allow
> Edits] = No
>  Else: SetValue [Forms]![SubForm1]![Allow Edits] = Yes
>  End If
>
> End Sub
>
> ** If the form element called Locked is checked, then set the form
> property Allow Edits of SubForm1 to No, else set value to Yes.
>
> Again, I appreciate any thoughts or help you can provide to either add
> to the macro I have to do that evaluation of the form element value,
> or adjust the code so it can be used in both the AfterUpdate property
> of the checkbox and either the On Current or On Load properties of
> each subform.


0
nobody5268 (138)
1/23/2004 5:14:43 PM
Reply:

Similar Artilces:

Sub-forms of Sub-forms
I'm creating a data-entry form for 3 tables. There is a one-to-many relationship between table1 and table2 and a 2nd one-to-many between table2 and table3. What I would like to do is have the user select from a combo box on the main form a record from Table1. That would filter the subform on the main form to just the records from Table2 with the PK from Table1. I've got everything working fine up to this point, but am a bit confused on where to go next. I need a mechanism for the user to pick one of the records from Table2, and be presented with an entry for for all records in Table3 that have the selected PK from Table2. I've tried putting a 2nd subform on my main form, but am having trouble getting them to link together. Something else I tried, is putting a command button on each row of Table2's subform in continuous forms view to open up a seperate form for Table3. Try setting the Default view of the 2nd and 3rd subform to datasheet view. SY Greetings, Here is something I came up with that should do what you are asking: Do the Link Master/Child thing with the mainform and subform1. Subform1 will need to be in Datasheet view for this trick to work. The 2nd subform - which will also be placed on the mainform (and also needs to be in datasheet view) will have its recordsource be based on a query of the table for that subform (a query for table3). You will use a parameter in the criteria field of the query for the link field between table2 and...

Form
I have a table TBL_NAMES : IDNAME , Name_person , ETC..... (15 different labels) I have a second table TBL_POINTS : IDPOINTS , LINKNAME_PERSON , POINTS_ALGEBRA , POINTS_GYM , etc.... (25 courses) I have made a form where all the names are listed and when i click on a name another form is opened with that persons name on top and a number of labels and textboxes where i put those points in. So far no problem. BUT... i want one record per person. So the next time i click on his name i would like to see those points and be able to change them but i must not be able to create a new record. T...

Form, subform, sub-sub form?
Let' say we have an application for a production facility running 24/7 broken into 3 shifts 6-2,2-10,10-6 each production report date contains 3 shifts as above in each shift there can be from one to several different product runs (the average is about 4) but it could be more or less - it's not defined or definite for many reasons Then, for each run there is a production report of product, good pieces, bad pieces total run time for that product etc. etc. then for each run there is a list for # of rejects and reject code SO I have ProductionRuns with rejects subform 1 to many but this results in repeated entries of shift, date, time. So i could make a main table for these and have the production run as a subform to this, but then I have a subform to the prodution run form. This gets confusing and requires me to put buttons for starting new date or shift. Any better way of doing this? Without knowing the structure of your data, it would seem to me that you would have a form with production run as the record... with a selection of Date and Shift in the Form Header. Within that production run, same-level but separate subforms for regular production information and reject information. Using Combo or List Boxes in the header to select date and shift, then replacing the RecordSource with an SQL statement using date and shift as criteria would limit the production runs to that particular date/shift. Or, if you'd rather, use a calendar control to select the ...

Query By Form Using Same Sub Form and Main Form
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on another main and sub form. The requery on the sub form and refresh comands on the main form do not work when the form is first displayed and when the selection criteria is changed. Should I be doing a refresh and then repaint of the sub form. > ' Creates saved query in the database container for the sub form Call BuildSql("") ' The following commented line correctly displays query results on a seperate sub form that has the results from the criteria selected on the form currently in use. 'Docmd.OpenForm "MainFormSeachResults ' The following two lines attempt to display the results on a sub form which is on the same form where the criteria is selected: Me.frmSubFormResults.Requery Me.Refresh < Hi Tom, I often use an unbound main form to collect criteria, then show the results in a datasheet-style subform. I create the SQL string using code, and then use that string as the Recordsource for the subform directly (no need to save it as as query in the the database container) As an added bonus, the subform refreshes automatically ... no need to "Refresh" or "Repaint" anything. Here's some sample code to illustrate: - lstFieldNames is a listbox containing field names ... which is one of the choices in the listbox&#...

Making MS Access Form as a standalone form like in VB
Well, its sames difficult for me; I love access so much and wish to make it perform extra task. I prepared an HTML form but can not connect it to my access table and so I think it is possible to make an access form a standalone form for user input. Can anyone assist. My mail add is dianafather@aim.com. *** Sent via Developersdex http://www.developersdex.com *** Oscar, why don't you just code up a VB form for user input and connect it to an Access backend? To my knowledge, you can't force an Access form to exist outside of Access. Your users would have to open the Access file to enter data, no matter how you set up the Access form. On Tue, 20 Dec 2005 11:35:09 GMT, Oscar N. Goyee <dianafather@aim.com> wrote: It's poor newsgroup practice to ask for email responses. Unlike what Steve said, you can create a form that lives outside of the Access main window: make it a popup. There is also nifty code out there (google for it), that puts the Access main window behind that popup, and moves it with it when it moves. To the end user it appears you have a single-form application. -Tom. >Well, its sames difficult for me; I love access so much and wish to make >it perform extra task. I prepared an HTML form but can not connect it to >my access table and so I think it is possible to make an access form a >standalone form for user input. Can anyone assist. My mail add is >dianafather@aim.com. > > > >*** Sent via Developersdex http://ww...

Forms and Form
Hi everyone ! 1) An example from help: "Each Form object has a Controls collection, which contains all controls on the form. You can refer to a control on a form either by implicitly or explicitly referring to the Controls collection. Your code will be faster if you refer to the Controls collection implicitly. The following examples show two of the ways you might refer to a control named NewData on the form called OrderForm: ' Implicit reference. Forms!OrderForm!NewData ' Explicit reference. Forms!OrderForm.Controls!NewData The next two examples show how you might refer to a ...

Forms/Subforms in MS Access Database
Why do my Forms/Subforms in my MS Access Database not appear? All I see is the boxes where they should show?! What did I do wrong? Thanks, John zufie wrote: > Why do my Forms/Subforms in my MS Access Database not appear? > > All I see is the boxes where they should show?! > > What did I do wrong? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Probably there isn't a name of a form in the sub-form's Source Object property. Also, the Link Child Fields and the Link Master Fields properties may be blank - you must enter the names of the link fields, they hold the field names that link the data between the forms. -- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBSSsUjoechKqOuFEgEQL+dQCfYUSwXFtPj0RRSZO+q3J8lQCD0/UAniRz JKu0h9AG0BAg8W3wC/0BC7B3 =Kvva -----END PGP SIGNATURE----- On Nov 24, 2:54=A0pm, MGFoster <m...@privacy.com> wrote: > zufie wrote: > > Why do my Forms/Subforms in my MS Access Database not appear? > > > All I see is the boxes where they should show?! > > > What did I do wrong? > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Probably there isn't a name of a form in the sub-form's Source Object > property. =A0Also, the Link Child Fields and the Link Master Fields > properties...

Form size question with Access forms, remote desktop, and MS Surface Pro
Hi, I know this is a stretch to ask this question, but: We have an Access 2010 application hosted using Remote Desktop. When we access forms from the desktop they look like they should. And from an iPad. However, a client is using their Surface Pro the forms are so tiny that she can't use them when accessing our application "on the cloud". Otherwise, they look fine on a Surface Pro when running it off the cloud. Does anyone have an idea? I do not think there is anything that the people that are hosting our software can do. -paulw On Monday, 29 February 2016 17:30:11 UTC, PW wrote: > Hi, > > I know this is a stretch to ask this question, but: > > We have an Access 2010 application hosted using Remote Desktop. When > we access forms from the desktop they look like they should. And from > an iPad. However, a client is using their Surface Pro the forms are > so tiny that she can't use them when accessing our application "on the > cloud". Otherwise, they look fine on a Surface Pro when running it > off the cloud. > > Does anyone have an idea? I do not think there is anything that the > people that are hosting our software can do. > > -paulw It will cost you, but have a look at a program called "ShrinkerStrether from Peter's Software (http://www.peterssoftware.com/ss.htm) This should shrink or stretch forms and all their controls to match the scr...

form access to form excel
Hello, How may I pass in VBA a value from a control in a access 2003 form to a control in a excel 2003 form ? I try this but it does'nt run: (oApp=word.application) oApp.Forms("saisie").tbnom.Value = Form_Form1.tbnom.Value & " " & Form_Form1.tbprenom.Value Thanks. ...

Continuous Forms with sub-form
I have a need to create a form containing schedule detail with a sub-form containing a crosstab of date detail. I would like to display it as a continuous form so the user can see related schedules together with the dates. Is there a way to get Access to do this? It won't allow continuous forms with sub-forms. Filling unbound controls on the main form only show the current record's date information. I would prefer not to use a big un-normalized temp table. On Wednesday, December 18, 2013 7:10:34 AM UTC-6, Ron Paii wrote: > I have a need to create a form containing schedule detail with a sub-form > > containing a crosstab of date detail. I would like to display it as a > > continuous form so the user can see related schedules together with the > > dates. Is there a way to get Access to do this? It won't allow continuous > > forms with sub-forms. Filling unbound controls on the main form only show > > the current record's date information. I would prefer not to use a big > > un-normalized temp table. Use a datasheet? Ron Paii wrote: > I have a need to create a form containing schedule detail with a > sub-form containing a crosstab of date detail. I would like to > display it as a continuous form so the user can see related schedules > together with the dates. Is there a way to get Access to do this? It > won't allow continuous forms with sub-forms. Fil...

Locking controls locks another form up...why?
I have 2 forms FrmMain and frmSearch. On frmMain I have to lock the textboxes and combo boxes on the form if the user logged out that record. FrmMain has a command button that launches frmSearch. While frmSearch (which is a regular form, not modal/popup,etc) is up, frmMain sits in the background. The problem is: when frmMain is displaying a locked record, and frmSearch is launched, the combo boxes and text boxes in frmSearch are also locked! Testing frmSearch by itself outside of frmMain showed the controls on frmSearch to behave normally. Here is the code that locks the controls on frmMain: (this locks all controls nicely on frmMain) For Each ctl In Forms!frmmain.Controls If ctl.ControlType = acTextBox Then ctl.BackColor = &HC0FFFF ctl.Locked = True End If 'lock the combo boxes that are here too If ctl.ControlType = acComboBox Then ctl.BackColor = &HC0FFFF ctl.Locked = True End If Next ctl So where in this code is a reference to frmSearch or another open form for that matter that all control on all forms are getting locked? Many thanks for your assistance... Looks strange, have you tried debugging something like: For Each ctl In Forms!frmmain.Controls If ctl.ControlType = acTextBox Then ctl.BackColor = &HC0FFFF ctl.Locked = True debug.print "Locked " & ctl.Name & ", frmSearch!TextBoxNa...

Form layout question: How move controls in a Form to (in) a Tab Control?
Hi, I created a form with a lot of controls on it. (textboxes, pulldown's etc.) Because the form is a little full I want to move the controls to different pages on a tab control. HOW can one do this?. If I drag them the tab control is not 'activated' if the mouse pointer is above the tab control. (if one creates a new textbox and place it on the tab control this tab control page turns black to show it's activated) This does not work while dragging??! Thanks in advance, Eddie Smit Holland. (The Netherlands) >Because the form is a little full I want to move the >control...

Open Form in Ms-Access from a hyperlink by using dhtml control
Hey ! I'm having a little ms-access application problem. in form A I have a dhtml control which I'm trying to assign it's documentHtml property a html string. I want that the html string will contain a hyperlink which open another form in access. Can I do that ? David ...

MS Access 2002
MS Access 2002 - query form control returns funny symbols like [][] I am running an append query on a form. Access is having trouble with the calculated fields and comboboxes. Example &#8211; referring to forms!FormName!ControlName within the query should return the value of that control, correct? I am receiving symbols such as boxes [] or [][] as well as Chinese symbols. Any thoughts as to why this is happening. thanks This happens if Access does not understand the data type of the calculated controls. Typecast the calculated fields, and set the Format of unbound controls. For more detail, see: Calculated fields misinterpreted at: http://members.iinet.net.au/~allenbrowne/ser-45.html -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Dman" <Derekst@hotmail.com> wrote in message news:b5358ccf.0411011951.51ec395e@posting.google.com... > MS Access 2002 - query form control returns funny symbols like [][] > > I am running an append query on a form. Access is having trouble with > the calculated fields and comboboxes. Example &#8211; referring to > forms!FormName!ControlName within the query should return the value of > that control, correct? > > I am receiving symbols such as boxes [] or [][] as well as Chinese > symbols. Any thoughts as to why this is happening. thanks ...

MS Access 2000 VBA Code Shows Totally Incorrect Date from Controls on a Form
Hi, Sorry for my English. English is not my native tougue. I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked tables in it. One of my forms has two TEXT BOX controls formated as Short Date. The form is binded to a linked table. The linked tables has about 7 records and one of the control is binded to a table field. These two controls displays the date correctly as 01/07/2006 and 31/07/2006 (I am running Windows XP, my regional setting is set to English Australia, location is set to Australia, language for non-Unicode programs is set to English Australia, and my date format is set to d/MM/YYYY) when the form is running. I have some VBA code behind the form to print out these two dates to a text file. The dates show up as 30/12/2005 and 30/01/2006. I really do not know why these dates are totally different. Here's my VBA code: Open "C:\Results.txt" For Output Access Write Lock Write As #1 Print #1, "GL run from "; Me.txtFromDate; " to "; Me.txtToDate Print #1, "" :: :: Close #1 I am hoping some one has come across with this problem. Thanks in advance, Easystart oh, so you mean you're just outputting everything to a text file? My guess is that since MS stores all it's data in US format, your have to force it into Australian format when you write it to the file. What happens if you use Format() and force it into the format you want? T...

focus from main form to sub form
Hi, I have a combobox who's values change the recordsource of the form. Within this form, there is a subform, whos records also need to change pending the value in the combobox. I am able to get the main forms values to change, but not the subform. I've only been using Access 97 for about a month now, so it might be fairly simple. Here is my code: Private Sub combo1_Change() If Me.combo1.Value = "Standard Procedures" Then Me.RecordSource = "tbl_stdProc" ElseIf Me.combo1.Value = "Policy" Then Me.RecordSource = "tbl_policy" ElseIf Me.combo1.Value = "Process Description" Then Me.RecordSource = "tbl_ProcDesc" ElseIf Me.combo1.Value = "Program Description" Then Me.RecordSource = "tbl_ProgDesc" ElseIf Me.combo1.Value = "Training Program" Then Me.RecordSource = "tbl_TrainProg" ElseIf Me.combo1.Value = "Qualification" Then Me.RecordSource = "tbl_Qual" ElseIf Me.combo1.Value = "Standard / Specification" Then Me.RecordSource = "tbl_StdSpec" End If ' Everything up to this point works fine. The problem starts below Me![frm_Type_sub].SetFocus If Me.combo1.Value = "Standard Procedures" Then Me.RecordSource = "tbl_stdProc_sub" ElseIf Me.combo1.Value = "Policy" Then Me.RecordSource = "tb...

Populate key from form to sub-form
I'm trying to figure out how to bring the key field from a parent form to populate the corresponding field in the sub-form during data entry, or to filter sub-form records during data viewing and updating. Can anyone help me? Bob Bob Mikels wrote: > I'm trying to figure out how to bring the key field from a parent form to > populate the corresponding field in the sub-form during data entry, or to > filter sub-form records during data viewing and updating. > > Can anyone help me? Use the subform's Link Master Fields & Link Child Fields properties. See the Access VBA Help article "LinkMasterFields Property" for more info. -- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) ...

Access Form --> Hyperlink to Excel --> Return to Original Access Form ?
I have an Access 2000 form that has a Hyperlink that opens an Excel 2000 worksheet located in the same network folder as the Access MDB. The Hyperlink works great. When users close the Excel File, they must choose the correct open Access form on the Windows Desktop Taskbar to return to the Access form that had the Hyperlink. Is there a way to: 1. Open the Access Form 2. Launch the Hyperlink to the Excel Workbook 3. Exit Excel, then 4. Return to the original Access form automatically - without clicking anything (such as the the TaskBar) I just need help with #4. Or, is there a better way to do this? Thanks John John wrote: > I have an Access 2000 form that has a Hyperlink that opens an Excel > 2000 worksheet located in the same network folder as the Access MDB. > > The Hyperlink works great. > > When users close the Excel File, they must choose the correct open > Access form on the Windows Desktop Taskbar to return to the Access form > that had the Hyperlink. > > Is there a way to: > > 1. Open the Access Form > 2. Launch the Hyperlink to the Excel Workbook > 3. Exit Excel, then > 4. Return to the original Access form automatically - without clicking > anything (such as the the TaskBar) > > I just need help with #4. > > Or, is there a better way to do this? > > Thanks > John > See if the code at http://www.mvps.org/access/api/api0018.htm works better. Thanks for the response. I wi...

calling a form sub from another form
Hi All This might sound simple, but I'm stumped. In essence I have a 2 form app that connects to an SQL db and extracts info from it. This works fine. The problem is with my 2nd form. The 'run through' is that the user can select an inv no from a combo box on form1 and when they select one, I auto-extract info from a db relating to this inv no, concat the various data fields with 2 other text fields (contains footer info) that are on form 2 and present it in a large text box on form 1. This also works fine. The problem is that the user may be previewing the large text box da...

Hiding Access Main Form/tables/queries/forms/etc
Thank you in advance for any and all assistance. Is there a way to hide the Main Access window with tables, queries, forms etc programmatically? Michael On Sat, 17 Jan 2004 17:17:16 -0600, "PMBragg" <pmbragg@megavision.com> wrote: >Thank you in advance for any and all assistance. > >Is there a way to hide the Main Access window with tables, queries, forms >etc programmatically? > Yes. Take a look here for some API code that will manipulate the Access window. http://www.mvps.org/access/api/api0019.htm - Jim Another way, with probably less control than the...

How to call a function located in a form module (form open in form view) from an Access Basic global module?
I would like to call a function stored in a form module in Access 2.0 from an Access 2.0 procedure in a global module. Function EmailTheOutletters () in module AppSpecific... .... 560 SSNtext = SelectRandomSSNtext(SSN) .... End Function SelectRandomSSNtext() is the procedure in the form module. I would use the syntax shown in line #560 if I were calling the function from within another procedure inside the form module. Do I have to reference it any differently if calling it from outside the form module? I don't think this is possible with Access 2.0 Solution: Put your function in a global module, and you can access it = from everywhere. --=20 Hope this helps Arno R "MLH" <CRCI@NorthState.net> schreef in bericht = news:53ch519mm1rhbojc8e8sav99t24v5roufm@4ax.com... >I would like to call a function stored in a form module > in Access 2.0 from an Access 2.0 procedure in a global > module. >=20 > Function EmailTheOutletters () in module AppSpecific... > ... > 560 SSNtext =3D SelectRandomSSNtext(SSN) > ... > End Function >=20 > SelectRandomSSNtext() is the procedure in the form module. > I would use the syntax shown in line #560 if I were calling the > function from within another procedure inside the form module. > Do I have to reference it any differently if calling it from outside > the form module? <snip> >I don't think this is possible with Access 2.0 >Solution: Put your function in a glo...

How to connect MS Access form to MS SQL Server
Hello all I created an application which use MS Access 2000 as user interface and MS SQL Server 2000 as backend. If I want to get data from MS SQL Sever 2000 and display them on the MS Access 2000 form, where do I set the database connection to the form (i.e. tell the form to get data from MS SQL server database)? Thanks Bon In Windows control panel, admin tools, data sources (ODBC), create a system DSN of type SQL server and fill in the parameters for your SQL database. In Access, select file / get external data, files of type ODBC. Select machine data source, select the DSN you created and the table(s) you need. ...

Locking controls on a form
TIA! I have an A2k mdb which contains a sample record so that my users can have an online example of input for a any given field. I don't want them to be able to edit the record, but also do not want to prevent them from doing a lookup for the live data, so using the allowedits property doesn't seem to be an option. Is there a way to lock all the controls without listing the over 60 controls individually, then unlock the lookup? I tried to use the enumerate controls from the access web faq, but haven't been able to modify for this purpose. "EJO" <5p1der@centurytel.net> wrote: > Is there a way to lock all the > controls without listing the over 60 controls individually, then unlock > the lookup? I tried to use the enumerate controls from the access web > faq, but haven't been able to modify for this purpose. This will lock all text boxes, combo boxes, check boxes and option groups: Dim ctl As Control For Each ctl In Me.Controls If TypeOf ctl Is TextBox Or TypeOf ctl Is CheckBox Or TypeOf ctl Is ComboBox Or TypeOf ctl Is OptionGroup Then ctl.Locked = True End If Next I'm not sure this is the best solution to your problem, I think you'd need to post more info. Regards, Keith. www.keithwilby.com > I have an A2k mdb which contains a sample record so that my users can > have an online example of input for a any given field. I don't want > them to be able to edit ...

locking sub-form only
Greetings. I have a form with a subform. Main form is attached to table of branches of our company, and sub form is attached to an orders table. Two tables are linked through branch id. When a user edits an order line the entire branch record is locked, and no other user can edit orders. However I just want to lock that specific order line, without blocking access to the entire branch. For this to happen which lock setting must be applied to each form? Currently I applied recordwise locking to subforms only but it doesn't work. Thanks On Mon, 3 Dec 2007 06:47:57 -0800 (PST), Cagdas Ozgenc <cagdas.ozgenc@gmail.com> wrote: If properly implemented this problem would not occur. Just for kicks, run the Northwind sample application and observe several users can edit OrderDetail rows, while others edit Orders. If I had to speculate, I would think your subform query erroneously includes a join to the Braches table. -Tom. >Greetings. > >I have a form with a subform. Main form is attached to table of >branches of our company, and sub form is attached to an orders table. >Two tables are linked through branch id. > >When a user edits an order line the entire branch record is locked, >and no other user can edit orders. However I just want to lock that >specific order line, without blocking access to the entire branch. > >For this to happen which lock setting must be applied to each form? >Currently I applied recordwise locking to sub...

Web resources about - Lock a Sub-Form from a Form control - comp.databases.ms-access

Resources last updated: 3/21/2016 7:12:51 PM