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  

Creating forms on the fly using a control file



 
 
Thread Tools Display Modes
  #1  
Old December 26th, 2006, 03:07 AM posted to microsoft.public.access.forms
jnh11
external usenet poster
 
Posts: 2
Default Creating forms on the fly using a control file

Attempting to create Access forms (2002 or 2003) on the fly using an external
control file. Each control file will define all data fields (for a given
form) including attributes (and edit/update rules) as needed. Each data field
will be "Unbound" and will be filled as needed from the Access data base
using edit rules in control file.
The control file will be modified (data fields be altered or removed) BEFORE
form is created based on user priviliges. One more complication: Procedure
must run with MDE.
Am currently doing above with a major application (several hundred programs)
running compiled QBasic. Any help would be greatly appreciated. jnh11

  #2  
Old December 26th, 2006, 03:20 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Creating forms on the fly using a control file

jnh11 wrote:
Attempting to create Access forms (2002 or 2003) on the fly using an
external control file. Each control file will define all data fields
(for a given form) including attributes (and edit/update rules) as
needed. Each data field will be "Unbound" and will be filled as
needed from the Access data base using edit rules in control file.
The control file will be modified (data fields be altered or removed)
BEFORE form is created based on user priviliges. One more
complication: Procedure must run with MDE.
Am currently doing above with a major application (several hundred
programs) running compiled QBasic. Any help would be greatly
appreciated. jnh11


Ain't gonna happen. Impossible in an MDE and impractical in an MDB.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #3  
Old December 26th, 2006, 04:45 AM posted to microsoft.public.access.forms
Larry Linson
external usenet poster
 
Posts: 3,112
Default Creating forms on the fly using a control file


"jnh11" wrote in message
...
Attempting to create Access forms (2002 or 2003) on the fly using an
external
control file. Each control file will define all data fields (for a given
form) including attributes (and edit/update rules) as needed. Each data
field
will be "Unbound" and will be filled as needed from the Access data base
using edit rules in control file.
The control file will be modified (data fields be altered or removed)
BEFORE
form is created based on user priviliges. One more complication: Procedure
must run with MDE.
Am currently doing above with a major application (several hundred
programs)
running compiled QBasic. Any help would be greatly appreciated. jnh11


That may have been an appropriate solution in QBasic; it almost certainly is
not an appropriate solution in Access. Unbound forms can be done in Access;
almost certainly, using unbound Forms to enter, manipulate, and display data
is not the best way.

If you'd explain what you have, and what you are trying to accomplish,
rather than how you had decided to implement it, perhaps someone could offer
useful suggestions.

Larry Linson
Microsoft Access MVP


  #4  
Old December 26th, 2006, 03:12 PM posted to microsoft.public.access.forms
dragos
external usenet poster
 
Posts: 4
Default Creating forms on the fly using a control file

jnh11 wrote:
Attempting to create Access forms (2002 or 2003) on the fly using an external
control file. Each control file will define all data fields (for a given
form) including attributes (and edit/update rules) as needed. Each data field
will be "Unbound" and will be filled as needed from the Access data base
using edit rules in control file.
The control file will be modified (data fields be altered or removed) BEFORE
form is created based on user priviliges. One more complication: Procedure
must run with MDE.
Am currently doing above with a major application (several hundred programs)
running compiled QBasic. Any help would be greatly appreciated. jnh11


Hello jnh11,

I'm not sure if that is what you want, but if I understand well, you
have to get "custom input fields" for your form. A possible workarround
is the following:

Make a form with enough unbound text boxes for your input data. Doesn't
matter how the controls are named. Set all fields to VISIBLE=FALSE.
Modify this code accordingly to your data and place it in the Load
event of your form.

Private Form_Load()
dim SelectList as String
dim iFieldCount as integer, i as integer
dim ctl as control
dim rs as recordset

SelectList = "Select * FROM MyView" 'Suppose you know how to define a
custom view dinamically

Me.RecordSource = SelectList
Me.Requery

Set rs = New Recordset '(or ADODB.Recordset if your sollution is ADO
based)
Set rs = Me.Recordset

iFieldCount = rs.Fields.Count
For Each ctl In Me.Controls

If (iFieldCount i) Then
Select Case ctl.ControlType
Case Is = acTextBox
If ctl.tag = "Your specific condition based on qBasic
control file"
ctl.Visible = True
ctl.ControlSource = rs.Fields(i).Name
ctl.Requery
Else
ctl.Visible = False
End If

Case Is = acLabel
ctl.Visible = True
ctl.Caption = rs.Fields(i).Name

i = i + 1
End Select
End If
Next ctl

That should work even with an MDE. The ideea of this workarround is to
make a custom select list based on external input conditions and then
set it to be your's form recorsource.
There are many possible aspects you shoud care about if you want to set
the permissions for the users but if you explain much detailed perhaps
I (or someone else) can help you.


Dragos

 




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 01:44 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.