Checkings Works In Form But Not In Subform

Aug 3, 2005

i have a DB to manage tasks. The main table, which contains information about the task on itself, is populated by a form. This form has a subform to add subtasks which are stored in another table.
The problem is that i can check if the information entered in the form is correct, but i can not do the same in the subform. The subform get information from the table where those records are stored. I tryed using before update and after update but it did not work. Also, it seems to be checking allways the first record.

example:
task 5 has the following subtasks: A,B,C,D
if i try to check the values it allways check against the first subtask (A).

Private Sub subtask_AfterUpdate()
MsgBox "Please, fill the DESCRIPTION field."
Me.taskdescription.SetFocus
End Sub
Private Sub subtask_beforeUpdate(Cancel As Integer)
If Me.subtask = DLookup("[subtask]", "change_desc", "[change_id2]=" & Me.change_id2 & "") Then
MsgBox "This task letter already exists."
Me.subtask.SetFocus
End If
End Sub


thx in advance, Max.

View Replies


ADVERTISEMENT

Forms :: Command Button To Populate Unbound Text Boxes From Subform Only Works Once

May 22, 2015

I have a tabbed form from which the user can select a contact's record from a subform on the first tab, click a edit command button, and the unbound text boxes on the top of that tab populate. The user can then click the second tab with employment history which has blank unbound text boxes and another subform which is linked by the contact id to the first tab.

The user can select a record in the second tab, click a command button and the text boxes populate no problem. The problem comes when the user changes the contact on the first tab, and then tries to edit a record on the second tab. Then I get a run-time error '-2147352567 (80020009)' saying the value you entered isn't valid for this field. Why it would work the first time by not the second?

View 7 Replies View Related

Updating A Field On A Form-why This Works

May 29, 2007

hi,

I just want to understand why this works. I have some fields on a form that I'd like to let the user change. If I put something like "rs.update me.first, trim(me.first)" in the form's event procedure , "on update" why doesnt it like it?
I moved the same code to the field's on dirty event and it is ok. I don't understand why it doesn't let me update one field on the form's event. (Oh, my records can be selected by a drop-down or by navigating with the record selector.)

thanks a lot!

View 4 Replies View Related

Forms :: Combo Box Works Only When Target Form Is Initialized

Jul 2, 2013

I have two forms. In form 1, there is a combo box that I have set on click to open form 2 in this manner:

Code:
Private Sub boxEditEntry_Click()
DoCmd.OpenForm "frmSRTEdit", , , "[ControlNumber]=" & Me.boxEditEntry
End Sub

The thing is, this has only worked when Form 2 is already open. I can't figure out why. If Form 2 is not open or has not been opened, the on click will still open Form 2, but not to the value in the combo box, or any value for that matter, it's blank. I really need it open if has not yet been opened or if it has been closed before. Also, I'm fairly new to access and I have no clue what I'm doing in vb.

View 2 Replies View Related

Queries :: ODBC Call Failed On Query But Form Works

Aug 7, 2013

When running a query in Access 2013 or 2010 we get an ODBC call failed. However when we run just the form, which the query connects to, it works just fine.

View 3 Replies View Related

Forms :: Combo Box Works In A Form But Not Updating Field Using Combobox Value

Jul 24, 2014

This DLookUP works correctly...

UNDER CONTROL SOURCE:
=DLookUp("[First Name]","Contacts","[Combo378]='" & [Forms]![PROFILE]![Combo378] & "'")

but when a I want to close the form, display the error:

You must enter a value in the Profile.First Name

I junt need the way to update the field in the new table...

View 6 Replies View Related

DLookup - Check If ID Matches Textbox It Works / However If Form Is Null It Doesn't Work

Mar 26, 2015

basically am creating a booking system, i have a add a room form. my form should check whether i already have a room number in my table, which works when the form is filled in. however when my form is null, then i press add new room button, i get this error rather than " please fill your form in"

Error: runtime error '3075' syntax error (missing operator) in query expression 'Room Number ='.

room number is a number field, integer but has primary key. i cant keep autonumber, as my requirement is to add new room number, but the roomnumber has to be unique.

here is the dlookup;

If DLookup("RoomNumber", "tblRooms", "RoomNumber = " & Forms!RoomPackages!txtRoomNumber) > 0 Then
MsgBox "This number already exists."
Else

p.s it unbound form

View 3 Replies View Related

How Does This Works? Please Read

Aug 23, 2005

There is an Access application somewhere in shared drive.

100 users open this application using a batch file which copies this database on their c: . They start using this database and the master database gets replicated real time. I am not sure if all the database are replicated as it is copied everyday ( so that each one of them has latest version of the application )

Is it possible ( I know it is :) ) but i am not able to figure out how it is happening.

Please help :confused:

View 2 Replies View Related

Works - Now It Doesnt

Dec 9, 2005

What would trigger an error to occur if there has been no changes to a DB.

My error # is 2427 (You entered an expression that has no value).

This error occurs when I click on a command button to open a report. When I debug, it sends me to an IF statement that I have loaded in the On Format of the report.

This worked perfectly fine before - the If statement is simple, if a value is true, then it changes a box to bold and if the value is false, the box in the report remains the same weight.

I am not understanding why it is saying that I have entered an expression with no value when the IF statement reads both the true and the false of a chkbox and adjusts the box accordingly.

Can someone explain why this is occuring? Im litteraly stuck.

View 14 Replies View Related

Which Event Works Best?

Dec 27, 2005

Hi,
I have a form which has two separate subforms in it. When the user selects a record in the first subform, I want the values of that record to write to the second subform's fields. OnCurrent works when there is more than record in the subform. My problem is two fold, one I don't want my copy code to run when the form loads and I need it to copy a record when there is also only one record in the subform.

Which event do you recommend?

Also, does anyone have a suggestion on how to allow the user to tab through a form, but really only record by record (with the keyboard) and not having to go through all the fields before getting to the next record.

Thank you,
Colette

View 1 Replies View Related

Msgbox Works On One DAP, But Not Another.

Jun 30, 2006

Hi, I'm a little confused here. I'm using the following on one DAP and it works just fine. When I add it to another page, it does not work. Any ideas?

<SCRIPT language=vbscript event=onclick for=Save>
MSODSC.CurrentSection.DataPage.Save()
msgbox "Record Saved - you may continue to edit or exit your browser.",64,"Saved"
</SCRIPT>

Thanks...Doug

View 1 Replies View Related

Text Box That Works Like Word?

Apr 18, 2006

Hi All,

I have a text box (memo field) that the user enters a description. This is sometimes more then one paragraph. In a text box you cant hit enter and goto the next line (or paragraph). I would like to to this? can it be done?

Thanks

View 1 Replies View Related

Text Box That Works Like Word?

Apr 18, 2006

Hi All,

I have a text box (memo field) that the user enters a description. This is sometimes more then one paragraph. In a text box you cant hit enter and goto the next line (or paragraph). I would like to to this? can it be done?

Thanks

View 5 Replies View Related

Deleted Some Code, Now Nothing Works

May 12, 2005

Can someone please help me. I was in the code view of my database and accidentally deleted a few lines of code and now everything i do is coming up with the same error message

Module Not Found

For every form I try to open it does this and even my buttons to close form and to exit system do not work.

Has anybody had this problem before?

Would anybody mind taking a look at it if I sent a zipped version? my email and msn is nicholaseary@hotmail.com

View 2 Replies View Related

Access 97 Dont Works

Aug 16, 2005

I have installed on my PC, WindowsXP sp.1, MSaccess versions 97 and XP.
After I have tested some databases, MSaccess 97 don't works successfully more, but XP version works good. I can't modify files mdb. Access works like in run-time mode: bars and commands reduced, standard icon of access absent, database window absent, ecc.
If macro autoexec or a form that play at the start of mdb are present, mdb works but it is impossibile to modify it. Otherwise mdb dont works, I can see access window with only menu files and window.

I have removed access and after yet installed it, but it don't work successfully.

maybe other application leaved files (or modification in file registry) that install procedure of access97 cant rewrite? And that dispose access 97 to work in run-time mode (or like)?

I am hopeless. Can You help me? Can you give me a list of files to remove, or list of modification to do in registry?

Danit :

View 4 Replies View Related

SendReport No Longer Works

Oct 24, 2005

I'm using Access 2000 along with Oulook 2003. Since we changed email servers, the send report no longer works. The addresses no longer appear to be valid. I can manually put all the names in every time an email is sent, but that is defeating the purpose!

I even tried changing the addresses to what an outsider would use rather than our internal name list; (milko@valspar.com instead of Mary Ilko) but this didn't work either.

Here's the code:
Private Sub cmdMailApproval_Click()
OnError GoTo Err_cmdMailApprovalClick

Dim stDocName As String

stDocName="rptForApprovalReport"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acViewPreview,, "[Batch#]=forms![frmInbound]![Batch#]"

DoCmd.SendObject acSendReport, StDocName, acFormatSNP, "FirstName Lastname",,,"Pre SHip Approval", "Please see the attached."
DoCmd.SendObject


Thanks in advance for your help!

Mary :o

View 1 Replies View Related

Between Dates Works Once Then Goes Wrong

Nov 14, 2005

Hi

I am using the following vba / SQL to create a query which looks between two dates in a table. It seems to work first time but thereafter my query pulls back dates which are not in the criteria (dates are selected from Combo boxes - search_chasestartdate and search_chaseenddate):

If (Search_ChaseStartDate <> "" And Search_ChaseEndDate <> "") And intPosition = 0 Then
strParameter = strParameter & "Sales.Chase between #" & Search_ChaseStartDate & "#And#" _
& Search_ChaseEndDate & "# "
intPosition = 1
Else
If (Search_ChaseStartDate <> "" And Search_ChaseEndDate <> "") And intPosition = 1 Then
strParameter = strParameter & "AND Sales.Chase between #" & Search_ChaseStartDate & "#And#" _
& Search_ChaseEndDate & "# "
End If
End If

If strParameter <> "" Then
strSQL = "SELECT Sales.* FROM Sales WHERE " & strParameter & ";"
Set qdf = dbs.CreateQueryDef("Business Master Query", strSQL)
DoCmd.OpenQuery "Business Master Query", acViewNormal, acReadOnly
Else
MsgBox "You have not selected any parameters to search on. Please try again.", vbOKOnly
End If

Does anyone have any idea why this is happening? I have been stuck for a while on this.


Thanks!

Mark

View 5 Replies View Related

Subquery Works Alone, But Not With Query.

Oct 4, 2006

Hi,

I have written a subquery that works fine alone, but it returns -1 when with query.

The subquery is supposed to return a total of type currency.

Any help/suggestions will be very much appreciated.

SELECT tblSite.Name, tblPhase.Phase_No, tblVariation_Order.Customer_No, Exists (SELECT Sum(tblVariation_Order.VO_Price)
FROM tblCustomer INNER JOIN tblVariation_Order ON tblCustomer.Customer_No=tblVariation_Order.Custome r_No
GROUP BY tblCustomer.Customer_No;) AS Expr1
FROM (tblCustomer INNER JOIN tblVariation_Order ON tblCustomer.Customer_No = tblVariation_Order.Customer_No) INNER JOIN (tblSite INNER JOIN (tblPhase INNER JOIN tblHouse ON tblPhase.Phase_No = tblHouse.Phase_No) ON tblSite.Site_No = tblPhase.Site_No) ON tblCustomer.Customer_No = tblHouse.Customer_No
WHERE (((Exists (SELECT Sum(tblVariation_Order.VO_Price)
FROM tblCustomer INNER JOIN tblVariation_Order ON tblCustomer.Customer_No=tblVariation_Order.Custome r_No
GROUP BY tblCustomer.Customer_No;))=True));

View 5 Replies View Related

Query Works But With Errors?

Jun 25, 2007

I've got a number of different append and delete queries running on command on one of my forms, in which it makes a copy of all of the data on that form and included subforms, copies them into another table, and then deletes all of the data from that record. When this runs, I get an error saying "record deleted" and then another error message. Now it is deleting the records and it is moving them, however when i go onto one of the subforms, all the fields in the subform show "Deleted#" until i go back to the previous record or forward to the next, then they clear, but everytime it brings up the other error message it says "end or Debug" which I don't want it doing.

Is this the query? Or the coding?

Thanks

View 7 Replies View Related

Sub Works Only In Step Mode

May 12, 2005

It's been a while since I've been on the boards. Good to see lots of the same folks are still here. :D

I've got an interesting problem. I have a sub that calls another sub. Pretty simple there. The problem is that when sub A calls sub B, sub B does not appear to run. This is all sub B does:If Not IsNull(Me.txtNumber) Then
Me.txtNumber = Me.txtNumber + 1
End If
The weird thing is, sub B runs just fine if I run the sub B in step mode. If I set a break point and use F8 to step through the code line-by-line, it runs just fine. If I take out the breakpoint, the code no longer works.

Anybody have any ideas? I'm running Access XP Sp2 on Windows XP SP1. Thanks.

View 3 Replies View Related

DLookUp Works Great BUT

Feb 28, 2008

here is the code I put in the OnExit of the InDate

If DLookup("[BeginDate]", "GroupEvent", "[In Date] >= [BeginDate] And [In Date]<= [EndDate]") Then

It works great BUT I need to get the Activity and Number field information from the record. I cannot use another DLookup cause it pulls the Activity information from the first record and not the found record. Any Ideas?

GroupEvent Table :
Fields are BeginDate, EndDate, Activity and Number

Thanks
Ed

View 1 Replies View Related

MsAccess2002 Ade Works In Some Computers And Doesn't In Others

May 9, 2005

Hello All,
I have MSAccess ade working in some computers which has WindowsXP-pro(SP1 and SP-2) without any problem. But It doesnot work(When i said it doesn't work means it doesn't work in certain parts which i will give an example) in some computers that has exact same configaration. The problem is when I try to instance a class using a TypeName function, it doesnot recognize the class name and just returns an object rather than recognizing the class's name. Its a strange thing because I have some .ade from past works fine in all machines. The only difference is In the new .Ade is I have included the Microsoft outlook 11.0 object library. But the part of the code thats not working doesn't even use the Outlook library at all. So did anyone has this kind of problem, PLease suggest or ask me if you have more details of this problem. I really appreciate your help.
Thanks again
ds111

View 2 Replies View Related

Inner Outer Right Left It Works But I Dont Know Why

Sep 16, 2005

I have a qry I need for picking the info for sending a series of letters out. I finally got it to work and now Im wondering if there is a better more efficient way. The qry I call to generate my report calls on information from 10 other queries and 7 tables. Some of the other queries are needed for other sub-forms that rely on the data. Is this something I should change? or just be happy it works???
-Dan :D

View 1 Replies View Related

Access Reformats My SQL - And Then It No Longer Works!

Apr 5, 2006

Situation: I have written a fairly straight forward nested query which aggregates sales & activity data (num_calls, date, etc.) by customer specialty (CODE_ESP_ACC1) in a single query. The SQL I have written to achieve this is as follows:


SELECT Q002.GP, Sum(Q002.Num_Calls) AS Total_Calls
FROM (SELECT Q001.CODE_ESP_ACC1, Count(Q001.ACT_ID) AS [Num_Calls], Iif([Q001].[code_esp_acc1]="MG" or [q001].[code_esp_acc1]="MF",1,0) AS GP
FROM (SELECT [06 Act 2005 Hosp - IM].ACT_ID, [06 Act 2005 Hosp - IM].TER, [06 Act 2005 Hosp - IM].ACC_ID, [11 Physicians with main specialty].CODE_ESP_ACC1, [06 Act 2005 Hosp - IM].DATE
FROM [06 Act 2005 Hosp - IM] LEFT JOIN [11 Physicians with main specialty] ON [06 Act 2005 Hosp - IM].ACC_ID = [11 Physicians with main specialty].ID_ACC
WHERE ((([06 Act 2005 Hosp - IM].POSITION)=1))) AS Q001
GROUP BY q001.code_esp_acc1, Iif([q001].[code_esp_acc1]="MG" Or [code_esp_acc1]="MF",1,0)
HAVING (((Q001.code_esp_acc1) Is Not Null))) AS Q002
GROUP BY Q002.GP;

This works absolutely fine. I can save this query and run it many times without problems. However, if I then re-enter SQL edit view, Access reformats it as follows:


SELECT Q002.GP, Sum(Q002.Num_Calls) AS Total_Calls
FROM [SELECT Q001.CODE_ESP_ACC1, Count(Q001.ACT_ID) AS [Num_Calls], Iif([Q001].[code_esp_acc1]="MG" or [q001].[code_esp_acc1]="MF",1,0) AS GP
FROM (SELECT [06 Act 2005 Hosp - IM].ACT_ID, [06 Act 2005 Hosp - IM].TER, [06 Act 2005 Hosp - IM].ACC_ID, [11 Physicians with main specialty].CODE_ESP_ACC1, [06 Act 2005 Hosp - IM].DATE
FROM [06 Act 2005 Hosp - IM] LEFT JOIN [11 Physicians with main specialty] ON [06 Act 2005 Hosp - IM].ACC_ID = [11 Physicians with main specialty].ID_ACC
WHERE ((([06 Act 2005 Hosp - IM].POSITION)=1))) AS Q001
GROUP BY q001.code_esp_acc1, Iif([q001].[code_esp_acc1]="MG" Or [code_esp_acc1]="MF",1,0)
HAVING (((Q001.code_esp_acc1) Is Not Null))]. AS Q002
GROUP BY Q002.GP;

... and this no longer works (syntax error in FROM statement).

To save you sifting through the SQL, the error is caused by Access replacing the soft brackets () aroung the outermost FROM statement with an object identifier-style hard bracket []. - specifically, the outermost SELECT statement now reads
SELECT Q002.GP, Sum(Q002.Num_Calls) AS Total_Calls
FROM [
instead of

SELECT Q002.GP, Sum(Q002.Num_Calls) AS Total_Calls
FROM (
and the alias for the subquery reads
]. AS Q002
instead of
) AS Q002

Changing the Access alterations back to my original fixes this problem - so the problem is more an annoyance than a disaster. However, I have no idea why Access is doing this to my query, nor how to prevent it from doing so. Does anybody have any experience of this behaviour in Access and any ideas of how to fix it?

Help! Replies appreciated.

View 1 Replies View Related

Query Only Works Through Clicking On Icon

Oct 1, 2007

i posted about this the other day, thought i sorted it and now it keeps coming back to haunt me

i have an append query in my database it is based on 3 other queries

when the query is run using vb

DBEngine(0)(0).Execute "QRY_ImportDuplicatesTopLevel", dbFailOnError

or by putting its sql into a string and executing using CurrentProject.Connection.Execute strSQL

i get an error message saying too few paramters - expected one

i'm fairly used to these messages which mean that in the query is a non existent or misspelt field and i find them by running the query in the query viewer and letting access highlight the missing / misspelt field

the weird part is that when i run this query as a stored object by clicking on its icon i get no error and the query does the job it is supposed to do

does anyonw have any idea why this situation could occur?

View 4 Replies View Related

Only Works If I Leave And Reenter Record

Oct 5, 2005

I have an unbound text box that displays when certain criteria exits, which I placed in the Form's properties, "On Current" ...

If [Decor6Date] <= Date - 30 And [NonrecommendQuestion] = 0 And IsNull([DateDecReceived]) Then

[LateDecoration2] = "Late Decoration"

Else

[LateDecoration2] = ""

End If

I then made a timer event to show/flash the message

Me!LateDecoration2.Visible = Not (LateDecoration2.Visible)

Everything works fine ... the problem is the message will only flash if I exit the record then return to the record. How can I fix that problem? I tried Refresh ... no luck.

Any help would be appreciated.

View 1 Replies View Related







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