Problem To Open New Form With DataEntry=True.

Apr 24, 2005

Hi,
I have Add button. When i click on the button, it will open frmstaff for me to enter new staff record. Now, i have to set DataEntry=True. It means i have 2 forms, one for data entry and another form to view previous staff records. Is it possible for me to do like this?


Private Sub cmdAdd_Click()
Set Forms("frmstaff").DataEntry = True
End Sub


but it will give me error,
Invalid use of property.

any idea? thanx in advance..;)

View Replies


ADVERTISEMENT

Open Query If Field Is True

Jun 6, 2006

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View 1 Replies View Related

Open Query If Field Is True

Jun 6, 2006

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View 1 Replies View Related

Open Query If Field Is True

Jun 6, 2006

I have 3 queries that pull from 3 dfferent tables. All 3 tables contain a field called Acct but the other fields in the 3 tables are different. What I would like is to have a form field that the user can input an account number and depending on which query the account number is in, that query and result will display. I have been trying the dlookup function but can't seem to get the coding down. Also, if the account number is not in any query I would like a message box to display saying it can't be found. Thanks for any help!

View 3 Replies View Related

Open Query If Condition Is True

Jun 15, 2006

I have a database with 3 tables. Each table has an account number field however the tables are completely different as are the account numbers that populate them. To go with the tables are queries that will bring in desired information. What i would like is for the user to input an account number on a form and have some code in the background that will find the account number in the table it is in and open the corresponding query. Is this possible? Thanks for the help. I have been trying to write code with DLookup but can't seem to get it to do what I want.

View 7 Replies View Related

General :: Setting Open New Window Value To True

Jan 16, 2013

I was reading how to make a a button open a webpage. I found out how to and what to type in the Visual Basics. It worked but like another user said, when ever he clicks the button, the window opens for the website but the window is not maximized. He said "I set the open new window value to True".

View 1 Replies View Related

Dataentry

Jul 12, 2006

Hello Gurus
I have a d/base and all is well
however i start entering data in via forms and occasionly it throws a wobbly and says " another users has etc do you wish to keep changes - if you say yes it puts boxs in the data fields -- i must be doing something wrong

thoughts on this guy

View 1 Replies View Related

Filter On A Form True/false/neither

Jun 2, 2006

Is it possible to filter a forms records by using a boolean True/False field.
I want to show all current records for option 1, Expired records for option 2, and all records for option 3. The form is based on 'tblMembers' which has a field [Expired] which is a boolean yes/no field formatted to true/false.

View 1 Replies View Related

Returning True/False To A Form When Query Is Run?

Mar 9, 2007

I'm really not sure how to go about this. I'm creating a course booking system and when creating a booking I need to check for current bookings with the same employee and course id's (i.e. the employee is already booked on the course). The query takes the employee and course id's from a form, and is initialised when the 'book' button is pressed. It correctly selects if the person is already booked on the course but I want the query to return a value to the form i.e. if it returns null/false then the booking can be created but if it returns a record/true then the booking already exists and a message box can be displayed.

I'm not sure if I'm going about this the right way, can anyone suggest how this can be done as described above or suggest a better way of doing the task?

View 5 Replies View Related

Forms :: True / False - Form Properties Based On Field Value

Sep 10, 2014

On my form ECOs

When my text box RELNUM is > 0 I want form properties AllowEdits set to FALSE.

When RELNUM is null I want form properties AllowEdits set to TRUE.

This must be possible, but not entirely sure where to start.

Since I can scroll through records in this form I'm thinking I have to put an event in ON LOAD, bbut beyond that I'm at a lost.

View 11 Replies View Related

Form Field Validation - "Cancel = True" Problem

Feb 21, 2005

I'm calling this code on my Form's BeforeUpdate Event which I understand should only run if the form is dirty. In this example, the code should check to see if 4 fields ("txtField1", "txtField2", txtField3", "txtField4") have data present, if not highlight them yellow.

Function Msg()
Dim ctl As Control
Dim strFields As String
Dim strControl As String
Dim intCounter As Integer
Dim blnEmpty As Boolean

For Each ctl In Me.Controls
blnEmpty = False
If ctl.ControlType = acComboBox Or acTextBox Then
If ctl.Visible And Len(ctl.Tag) > 0 Then
Select Case ctl.Tag
Case "txtField1", "txtField2", txtField3", "txtField4"
If IsNull(ctl.Value) Then
blnEmpty = True
ctl.BackColor = vbYellow
Else
ctl.BackColor = vbWhite
End If
Case Else
If ctl.Value = 0 Then
blnEmpty = True
ctl.BackColor = vbYellow
Else
ctl.BackColor = vbWhite
End If
End Select
If blnEmpty Then _
strFields = strFields & ctl.Tag & vbCrLf
If blnEmpty Then _
If Len(strControl) = 0 Then _
strControl = ctl.Name
End If
End If
Next

If Len(strFields) > 0 Then
Cancel = True
MsgBox "You have not completed all data fields, " & _
"please enter data in the following fields:" & vbCrLf & strFields, _
vbExclamation, Me.Caption
Me(strControl).SetFocus
Me(strControl).BackColor = vbWhite
Exit Function
End If
End Function

However, it keeps falling over at:
Cancel = True saying "Compile Error: Variable Not Defined"

I want to be able to run this code from a "Close Form button" to ensure that either the record is not created unless the fields listed are filled in or the form closure is cancelled so that the user can complete the missing data.

I've seen varients of this code on a couple of Access forums but can't find a solution for the "Cancel = True" issue.

Am I doing something wrong?

View 2 Replies View Related

Forms :: When Open A Form / Want To Open Another From At Same

Jan 14, 2015

when i open a form i want to open another frm at the same time. i have a main form with some buttons in it. when i click on a button and a form opens then i am not able to click on a button to open other forms from the main form.

View 2 Replies View Related

Closing An Open Form From Another Form That Is Open

Dec 17, 2004

Is there a way to close a form that is open from another form that has the focus. I tried using the Unload event, but I received an error message "Cant load or unload the object". I would appreciate any help!

View 1 Replies View Related

Forms :: Button In Form To Open Different Form And Chose A Customer Based On Last Form

Mar 26, 2013

Basically I have a Customer Form, which I have a New party button on it,this button opens up the party form to a new party, what I would like it to do is open up a new party but make the new party for the customer I had selected in the previous form.I have tried the GoTo macro's but cannot seem to get it to work.

I am thinking on clicking the button it will need to get the Customer ID, and then open the party form, create new party, and paste in the Customer ID, which then updates the Name - Date - Address - Company Fields.

View 5 Replies View Related

If A Is True, Then Do B

Apr 9, 2007

=IIf([Text34]<=2644,0,IIf([Text34]<=7164,650,IIf([Text34]>=242506,22000,[Text34]*0.0907194)))

The above formula works as is in the field I have it in, but need it performed only if [Label5] is marked yes. I guess what I need is what goes in front of the above formula. I've looked through the forum, but it is so huge I had no luck finding what I needed.

If [Label5] is no, I need it to go to [Label6] and if [Label6] is yes, perform another calc like the one above. If [Lable6] is no, I need an error message.

Hope this is clear. Any help is greatly appreciated.

Thanks.

View 3 Replies View Related

After Open Open Another Form

Jul 26, 2005

I want to open another form automatically when an initial form opens, both are non popup) I have tried open and load events - but still the calling form appears on top of the called form.

How do I get the two forms to open form 1 and then form 2?

Also I cannot use the timer event as this is doing something else.

Thanks

View 2 Replies View Related

Allowaddition = True

Sep 15, 2005

Hi all very simple question i'm sure but had a look through the forums and couldn't find anything.

On a form i have 2 buttons, one for new data and one for editing data. When either of these buttons are clicked a few text boxes pop up and immediately display data (The first record of the recordset). For the edit button this fine, however how do i get the text boxes to display a new record and not allow the user to head backwards through the recordset only onto a new record??

Thanks in advance

View 4 Replies View Related

Posting A Pic When A Value = True

Jan 31, 2008

Hi everyone,

I have made a form for our database and I would like to have a .gif image display when a certain checkbox is checked. Any idea how to do this?

Thanks

PS - sorry if this is a noob question...I don't use access much

View 4 Replies View Related

Locked=True Fuzzy

Jun 1, 2005

I have a form that has code tied to the 'on open' event that is going to be accessed by users where we want them to only have access to certain fields which we want them to fill out. The fileds that will be locked will change based on the field called 'Item Number'. The code will be long because there are 30 different Item Numbers and about 10 to 20 fields that we will disable based on the Item Number. The code is like:

Dim Item_Number As String
If Me.Item_Number = "32000" Then
Me.Batch_Lot_Number.Enabled = False
End If

This is all great except that the disable makes the field kind of obscure by the color it gives it. I don't want to use the lock property because that doesn't give you a visual clue that its locked.

Is there a way to change the color of the field background using VBA?

View 5 Replies View Related

Iif With True Part Containing 2 Values

Nov 28, 2005

First Post - please be gentle :)

I may be missing something here, but can any one help?

I am using a Iif statment in a query to filter records as follows:

If([value from a form]= "all holidays",("weeks hols" or "days hols"),"not a holiday")

This is returning a to complex to calculate error - I think it is a Syntax error but could be wrong
but if I enter The string "week hols" or "days Hol" as the criteria without the Iif statment that works fine.

Thanks Dean

View 5 Replies View Related

Counting True Items

May 4, 2006

Can anyone help?
I have a table with the following:
Booked with a y/n field
Person Name with a text field
So...
Yes(True) Jim
Yes(True) Jim
No(False) Jim

What I need is to be able to show a query that shows if the checkbox is ticked (True) and the Name is Jim total up how many true items there are. So from the above I can see that Jim has 2 true items. I would then like this shown in a text box is this possible?
Also, it is not always going to be a person called Jim so... (From above)
Yes(True) Jim
Yes(True) Jim
No(False) Jim
Yes(True) Jack

So how would this go on a query in a sub form? So Name Jim would show 2 and Jack would show 1? At the moment is is grouping the name and I dont want that.
Any ideas
Cheers

View 4 Replies View Related

Is It Possible To Return No Value When An If Statement Is True?

Sep 22, 2006

This should be really simple, but I am stumbling on the criteria. I have a combo box which returns "Y" or "N". I'm using this value as criteria for a field called [Planned=Y/N]. This field stores either a "Y" or a "N" to indicate that a network outage was planned or not. If the combo box is "Y" I want to return all values(Y and N). If the combo box is "N" I only want to return values of "N". I've tried the following in the criteria without the desired affect:

IIf([Forms]![frmOutagemenu]![cboflag]="Y","","N") - only returns records when "N" is selected.

IIf([Forms]![frmOutagemenu]![cboflag]="Y",null,"N") - only returns records when "N" is selected.

IIf([Forms]![frmOutagemenu]![cboflag]="Y",In("Y","N"),"N") - too complicated for Access to decode.

Is there another way to return nothing for the criteria when "Y" is selected?

View 3 Replies View Related

True Date Ranges

Nov 6, 2006

I run various queries on a daily basis for multiple date ranges (previous day, week to date, month to date, and year to date). The below criteria allows me to get WTD numbers but it has a flaw. When I run the reports on Monday, this criteria gives me Sunday and Monday's data when I actually want the previous week's data. Does anyone know of an iif statement that basically, says, "If today is Monday, give me last week's data, else give me wtd of the current week?" Right now, I manually change the criteria on Monday morning to hard code the dates and then revert to the formula on Tuesdays but I need to have this completly automated because there are a large number of queries and I don't have time to change them all. Thanks for the help!


Between Date()-Weekday(Date()-1) And Date()-1

View 2 Replies View Related

Count Of TRUE Statements?

Oct 18, 2006

Hi! When it rains, it pours, right? I'm wondering if any of you know of a way to count true statements...

What I mean is, I have a query where I have a series of 5 different OR statements, meaning I want to see records with either a min. ed. number, or a years of experience number, etc...

The query returns every record with at least one of the criteria being met. What I need is to count the statements that are true for one record. Let's say I have someone who meets all of the OR criteria, I need a way to count the number of criteria that they met. Is there a way to do this? Maybe with a crosstab query??? Thanks!!

KellyJo

View 3 Replies View Related

Too Simple To Be True? ...is This Design Proper?

Apr 30, 2008

New to Access, and having a heck of a time learning it...or rather learning how to correctly design databases.

All my expertise is with Excel. I'm creating a project where I use Excel to parse a non comma delimited text file, then feed certain figures into an Access database. This is all through VBA.

It wasn't until yesterday that I realized I had a problem. There are two text files with data that makes up one complete record. With what I already have built, and with what I have tought myself (ADO w/ VBA wise) I tought the easiest solution would be to create two tables that will hold the data from each respective text file. This is what I'm working with:

A store has a department with 5 areas of measurement that is collected daily. One complete record would be like this:

Date | Store | Dept | Sales | Cust Count | Item Count | Avg Price | Mix

...and there are (right now) 3 stores and 15 departments that are watched in this project. What I came up with for a table design was this. Fields with an "!" prefix reflects primary keys.

Table1 (using data from txt file 1): !Date | !Store | !Dept | Sales | Mix
Table2 (using data from txt file 2): !Date | !Store | !Dept | Cust Count | Item Count | Avg Price

In each table, I have to have a compound primary key to make up what is a unique record. I just learned I could use a compound index and an autonumber as my primary key. Either way, I'm using the 3 primary keys in each table with a 1 to 1 relationship. This seems to work if I make a query.

Now, will the way I did it hold up? Is there a better, more correct way to do it?

Thank you for the time & help!

View 4 Replies View Related

True Or False Query Issue

May 12, 2006

I have a query that shows banned users (I work in a school). When a student's ban has ended, a tick box is checked in a form linked to tblBannedUsers to show they are no longer banned.

The query itself simply queries all records in tblBannedUsers with a username field (UserID) taking search criteria from a box on a form.

However, I want to filter out the students that are no longer banned (those with a tick in the checkbox). To do this, I thought it would be a simple case of editing the query, and in the Ban Lifted field criteria, use =False to say I only want those records with a tick.

This doesn't work and I still get all records given the combo box filter (which are just filtering for a username...if I leave it blank it gives all records via Is Null).

What should I be putting in the criteria to filter out those records with a ticked checkbox?

Thanks,

Steve Swallow

EDIT: I've just done a test query and <B>No</B> is the criteria to use, but when I use this criteria in my query which also take data from a form's combo box it ignore the <B>No</No> criteria.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved