473,698 Members | 1,840 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 1349
>
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
1390
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
3611
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
3101
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
2335
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
2125
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
3093
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
3968
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
2567
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
8668
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
8598
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
9152
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
9014
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...
0
7708
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
6515
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...
1
3037
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
2320
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1995
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.