473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Unbound control problem

I am trying to resolve a problem I'm experiencing in Access 2000.

I have an unbound control which is set be code on the open event of a
form. However when I try to subsequently run some code which references
the value in the unbound control, the code cannot see the value set. If
however I manually type in the value into the unbound control the code
works fine.

I have tried to Refresh and Repaint the form, but this does not solve
the problem.

If anyone can suggest a solution, I would be very greatfull.

TIA
Trevor
;)
Nov 13 '05 #1
3 2336
What code and when are you running it!

--
Reggie

----------
"Trevor Hughes" <tr**********@inet.net.nz> wrote in message
news:10***************@kyle.snap.net.nz...
I am trying to resolve a problem I'm experiencing in Access 2000.

I have an unbound control which is set be code on the open event of a
form. However when I try to subsequently run some code which references
the value in the unbound control, the code cannot see the value set. If
however I manually type in the value into the unbound control the code
works fine.

I have tried to Refresh and Repaint the form, but this does not solve
the problem.

If anyone can suggest a solution, I would be very greatfull.

TIA
Trevor
;)

Nov 13 '05 #2
Reggie wrote:
What code and when are you running it!

This the sequence of events:
1. Onopen event of form: Code gets CurrentWindowsUser and sets the value
on the unbound control of the form. Then a DLookup sets the value of
another unbound control to show that users "Access level"
2. I then run a query from a list of available queries. Before the
query runs, my code checks to see if the CurrentWindowsUser has the
correct "Access level" to run the query. It's at this point where the
contents of the unbound control "Access level" is not correctly accessed.

Trevor
Nov 13 '05 #3
Trevor, Assuming that after you check the CurrentUser and you do indeed
"see" a value in you unbound control, and now I assume a user uses a
combo/list box to select a query name, now I assume you click a button that
runs/opens the selected query. There's no reason you cant use something
like(air code)

Private Sub cmdRunQuery_Click()
Dim strQuery as String
strQuery = Me.cboQueryList
Select Case Me.AccessLvlControl
Case 1 'Full access
DoCmd.OpenQuery strQuery, , acEdit
Case 2 'Some access so check what query they selected
If strQuery = "qry1" or strQuery = "qry2" Then
MsgBox "Please select a different Query.", vbOKOnly +
vbInformation, "Access Denied"
Else
DoCmd.OpenQuery strQuery, , acEdit
End If
End Select

This is bare-bones so modify /test as necessary. Hope it helps. If not
post back with actual code/events etc. you are using!
--
Reggie

----------
"Trevor Hughes" <tr**********@inet.net.nz> wrote in message
news:10***************@kyle.snap.net.nz...
Reggie wrote:
What code and when are you running it!

This the sequence of events:
1. Onopen event of form: Code gets CurrentWindowsUser and sets the value
on the unbound control of the form. Then a DLookup sets the value of
another unbound control to show that users "Access level"
2. I then run a query from a list of available queries. Before the
query runs, my code checks to see if the CurrentWindowsUser has the
correct "Access level" to run the query. It's at this point where the
contents of the unbound control "Access level" is not correctly accessed.

Trevor

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Cameron Laird | last post by:
Hi, I'm using Stephen Lebans RTF control in an unbound Access 2000 form. To populate the control I simply set the RTFtext property to the value of the memo field in the database containing the...
3
by: Dos Lil | last post by:
I have a unbound field in the subform(for calculating the datediff) which has the control property ==DateDiff("n",,). I have another unbound field in the main form which is for displaying the...
3
by: Pat | last post by:
Hello, I've used Sum() to total bound fields on a continuous form with no problem. However, I now have a continuous form, on which I use an unbound field to calculate the number of hours between...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
8
by: Robert | last post by:
I have a form (Worksheet) that works fine by itself. I have now created a seperate form (MainForm) that has a command button in the header and an unbound subform (FormFrame) in the Detail section....
3
by: scott_baird | last post by:
Probably something simple, but it's driving me up the wall... In a report, I have an unbound control that is the total of 2 other bound controls (currency) as follows: unbound control =cash1 +...
3
by: Richard | last post by:
How is the result of query placed in a unbound textbox ? Suppose CriteriaLookups has columns TableName, KeyColumn, KeyValue, DataColumn Foo,x,11,xhat Bar,z,3,xyzzy And
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.