473,395 Members | 1,762 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.

Lookup Fields and Forms - how do I control the combo box?

I have a standard two-table structure, Orders which has a lookup field to the Salesperson table. However when you build a form the salesperson field has the combo box feature - which I WANT when adding new orders BUT NOT when viewing existing orders (because you can actually change the salesperson by using it) - I am guessing I must use code (have no idea what code) and add it to a from so I can have a View orders form (which now displays salesperson as a locked text field) and an ADD orders form which the code is not attached to and therefore allows the user to choose the salesperson using the combo box.
Any thoughts?
Feb 13 '07 #1
2 2151
Rabbit
12,516 Expert Mod 8TB
You can lock a field in code by using:
Expand|Select|Wrap|Line Numbers
  1. Me.ControlName.Locked = True
Feb 13 '07 #2
NeoPa
32,556 Expert Mod 16PB
Try an On Current procedure for your form :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   Me!Control.Locked = (Not IsNull(Me!Control))
  3. End Sub
This will lock a field when it is selected and it has existing data, but unlock it if the field is empty.
Feb 14 '07 #3

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

Similar topics

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...
1
by: Zachary Turner | last post by:
I want to make a Lookup Field based on another Lookup field. In other words, I have this table A with two fields: ID and Name, where ID is an Autonumber and Name is a friendly name. Then I have a...
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...
1
by: tina.boroff | last post by:
Hi, I am new to Access and I am creating a form. I have the following: clients form which has the following lookup fields (in addition to other entry fields).... casemanager (from...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
3
by: silvastein | last post by:
It would be great if someone can help me with this. It seems like it should either be easy (so far, not!) or maybe it isn't possible. Here goes: Table B has TextField1 that looks up values...
5
by: Kevin | last post by:
I was reading on the mvps.org site not to use the lookup wizard in the table design, but rather use a query. I'm confused by this, given that the lookup wizard basically creates a query and uses...
2
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What...
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...
2
by: ApexData | last post by:
How do I use a combo-box to do a lookup on my name table “T-NAME”, and then place the values found in the lookup table (ie LNAME, FNAME, MI) into to a row in my existing continuous forms table...
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:
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
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:
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
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,...

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.