473,715 Members | 6,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need some help with subform

Hi everyone,

Well, kind of new to Access and VBA development in general.

What I have a query that returns me all records based on a criteria.

Now, I have a form where the user can choose this criterial via a combo
box and I want a sub form to show up with the relevant records.

I have 2 questions actually...

I tried the sub form wizard and I can point it to the Query but how can
I specify the where clause whith which it should filter the query
results...

How can I make it that the user can only view the data and not edit the
data in the sub form. Right now, it allows me to make changes to the
database through the cells in the sub-form. Can I stop that...

Cheers and thanks for any help you might give me.

Anja

Oct 7 '06 #1
2 1352
>
How can I make it that the user can only view the data and not edit the
data in the sub form. Right now, it allows me to make changes to the
database through the cells in the sub-form. Can I stop that...
set the AllowEdits property of the subform to False.

Oct 8 '06 #2
Anja wrote:
Hi everyone,

Well, kind of new to Access and VBA development in general.

What I have a query that returns me all records based on a criteria.

Now, I have a form where the user can choose this criterial via a combo
box and I want a sub form to show up with the relevant records.

I have 2 questions actually...

I tried the sub form wizard and I can point it to the Query but how can
I specify the where clause whith which it should filter the query
results...
In a subform, usually you link the two forms together based on one or
more fields.

In your case, you might want to look at Filter and FilterOn.

Let's say the combo is called Combo1. The first column in the ID field.
You could have code in the AfterUpdate event that looks like
Me("SubFormName ).Form.Filter = "ID = " & Me.Combo1
Me("SubFormName ).Form.FilterOn = True
>
How can I make it that the user can only view the data and not edit the
data in the sub form. Right now, it allows me to make changes to the
database through the cells in the sub-form. Can I stop that...

Cheers and thanks for any help you might give me.

Anja
Oct 8 '06 #3

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

Similar topics

4
1900
by: Jeremiah J. Burton | last post by:
I am trying to create a database (in Acces 2000) to track my fossil collection. I have a main table that has records for every specemen. I have a secondary table with information on localities that the specimens were collected at. The tables are linked. Each record in the specimen table will link to only 1 record in the locality table, however each locality can be linked to multiple specimens. I am trying to create a form (based on...
2
1393
by: Ellen Manning | last post by:
Using A2K. I've got a form with 2 subforms (a subform within a subform). When the user enters an amount on the main form, I place that amount in subform1 with no problem but can't seem to get it placed in subform2 correctly. It remains zero. Below explains it better hopefully: Amount: $25 <user enters amount and it gets placed in subform1 amount> <Subform 1> Fund #: <blank until user enters> Amount: $25
3
3614
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name in the subform. Is it possible? How do I do this? Thanks in advance. Paul from Slovakia
14
3104
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ; ExpenseType Data: 1 ; FOOD 2 ; AIRLINE 3 ; FARE
9
2358
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There is a Judge Table (information about judges) judgeID = autonumber key
2
2126
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a relative newcomer to Access and need to be methodical until it become more familiar. Thanks in advance for your help. I have a form with a subform that has a subform. form: frmEvents subform: sfrmTrialInfo (controlname = )
3
3095
by: congngo | last post by:
Below is my code. What I want do is ,after running the insert statement into tblarchive, I want to go to the subform and set focus to the record that I just added in Confirm = "'" + CONF + "'" usr = "'" + CurrentUser() + "'" strSQL = "INSERT INTO tblarchive ( conf, csrID, csdate, comments ) SELECT " & Confirm & " AS Expr1, " & usr & " AS Expr2, Date() AS Expr3, 'cxl' AS Expr4;"
1
1385
by: Eric | last post by:
There are two sub forms in main form. One has values: Outlet Equipment 2 ABCBCBD 3 DKJDKJD 4 KDJKDJK Second has also a variable name outlet. I need help how to i display the equipment next to the outlet in 2nd subform from first subform. I dont want to save this into table just need a display in the second
3
3970
by: suek | last post by:
I have a table with over 4000 records to search upon, and the users don't like a combo box. So what I have been trying to do for the last twelve hours is do some code to get a text box to search. I am learning fast, but I really don't know how to do it, and would appreciate some help. So far I have got to this: Private Sub btnSearch_Click() Dim strFindLocation As String
1
2568
by: sirdevo | last post by:
There is one combobox on a subform named Report Soil Series Subform1. The combobox is named cboSoilSeries. I need to disable this so the user can't enter values. I could also disable the whole subform since this is the only control on the subform. I've tried this line of code but it says you can't disable the control while it has focus. Forms!!.Form.cboSoilSeries.Enabled = False The combobox does not have focus when I run that line of...
0
8823
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9198
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9104
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
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
7973
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...
0
4477
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...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3175
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
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.