473,791 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2358
What code and when are you running it!

--
Reggie

----------
"Trevor Hughes" <tr**********@i net.net.nz> wrote in message
news:10******** *******@kyle.sn ap.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 CurrentWindowsU ser 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 CurrentWindowsU ser 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_Cli ck()
Dim strQuery as String
strQuery = Me.cboQueryList
Select Case Me.AccessLvlCon trol
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**********@i net.net.nz> wrote in message
news:10******** *******@kyle.sn ap.net.nz...
Reggie wrote:
What code and when are you running it!

This the sequence of events:
1. Onopen event of form: Code gets CurrentWindowsU ser 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 CurrentWindowsU ser 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
2662
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 RTF text. When my form opens I get a very unhelpful message that tells me: Property is read only. However, the RTF control is populated correctly and each record has data. I believe this is an issue with how Access puts the control onto the...
3
3779
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 datediff from the subform.I have set the controls source = .Form! FRM- TimeSheet Subform is the name of the subform and TXTTtalHoursworked is the name of the unbound field in the subform.
3
6340
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 two times stored in a record (bound fields). This field is called txtDuration. On my footer, I've created another unbound field named txtWeeklyTotal. I've set the Control Source to =Sum(), but this returns a #Name? error. I've tried . and it...
3
2758
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 (we're sales offices, and I'm doing things such as associate directories, commission calculations, order tracking, etc.). 2003 seems to have a few extra features, but I seem to continually run in to oddities that seem like they SHOULD work, but...
18
3804
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 trouble. I have tried keeping some of the fields bound and when I use the save button it has been saving as 2 different records. This is unacceptable. This is what I have, can anyone help me out with this?
8
8327
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. when the user clicks the command button, Worksheet is loaded into the subform control. At this point, some of the functions do not work. The user is prompted to enter a Parameter Value. Why wouldn't that form (Worksheet) work the same as a sub...
3
2015
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 + cash2 However, it is possible that either cash1 or cash2 can be null, in which case the unbound control displays nothing (apparently, addition only works with a zero or above). What I want to do is something along
3
11279
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
5190
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 button will open a new form (Form2). Form2 has two subforms. Both are embedded in the main form. (Subform2 is NOT embedded in subform1.) Subform1 displays records as a continuous form based on the Primary ID of the main form and lists the...
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.