473,395 Members | 1,462 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,395 software developers and data experts.

Unlocking Lookup without Unlocking Form

13
To say I'm new is an understatement - but somehow my boss decided I was the one to create a database in Access 2003...I'm nearly there. I have a small problem in that I have locked the main form (although not yet the subform) using:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Me.NewRecord Then
  3.     Me.AllowEdits = True
  4. Else
  5.     Me.AllowEdits = False
  6. End If
  7. End Sub
Then I have an Edit Button that folks can push to change data as needed - using:
Expand|Select|Wrap|Line Numbers
  1. Sub cmdEdit_Click
  2. On Error GoTo Err_cmdEdit_Click
  3.  
  4.    Me.AllowEdits = True
  5.  
  6. Exit_cmdEdit_Click:
  7.     Exit Sub
  8.  
  9. Err_cmdEdit_Click:
  10.     MsgBox Err.Description
  11.     Resume Exit_cmdEdit_Click
  12.  
  13. End sub
But I have a lookup box that shows all the students - I need to be able to have people navigate to the record using the Lookup, without yet being able to edit. But the Lookup is locked until the Edit Button is pushed. I would like them to use the Lookup, select the student and have the data load into the form - without them being able to edit it until the push the Edit Button. FYI the Lookup is part of the Main Form.
Is this possible?
Thanks!
Mar 13 '08 #1
3 1433
missinglinq
3,532 Expert 2GB
Sure! In the combobox's On Got Focus event set AllowEdits to True and in it's On Lost Focus event set AllowEdits back to False.


Welcome to TheScripts!

Linq ;0)>
Mar 13 '08 #2
SoNew
13
You are BRILLIANT! Thank you - works great!! :)
Mar 13 '08 #3
NeoPa
32,556 Expert Mod 16PB
Actually, I'm also quite impressed (Brilliant is not wrong). Neat answer Linq.

As for SoNew, I have to admit that your question is well explained and the given code far from n00bish. I've seen many members that couldn't handle that even after a long time posting on the site. Maybe your boss is not so stupid after all ;)

I certainly wish all questions were as clearly stated.

Welcome to TheScripts :)
Mar 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Next | last post by:
Hi Folks, I have added a ListBox lookup in one of my access tables. Problem is, my form does not reflect the changes (in other words, the form does not display the ListBox). Is there a way to...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
0
by: dbuchanan | last post by:
Hello, For my datagrid I added a datagrid table style to include columns from my lookup tables. These display the values in the lookup tables rather than just the integer key value stored in the...
5
by: Ryker | last post by:
I have a form that has name address, ect. The key is social security number. I have a lookup box where social security number is entered and the table is searched for a matching number. If there...
3
by: john | last post by:
In my form (table A) I have subform (table B (only 2 fieds: ID and App_name) where table A -Table B are linked 1XM. To be able to add a record in the subform I want to use a lookup form since the...
3
by: dancole42 | last post by:
I'm self-taught in Access, and as such I'm missing large chunks of knowledge, so I'm hoping someone here with some training can help me. Right now I have an Invoice form with a Customer subform....
3
by: NaeiKinDus | last post by:
Hello, i'm trying to program a thread that would be locked (by a mutex) and that would only be unlocked once that a function (generating data) is done. The purpose is to generate data, and unlock...
1
by: Nestor01 | last post by:
I use a lookup table which contacts 2 fields (item#, name) When a customer places an order, the order form contains a drop down to select the item by name (from the lookup table). The detail is...
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: 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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.