URGENT HELP Needed For VB Code

Feb 10, 2005

Hello all
I am having a problem with my vb code. I am realatively new to vb and what I am trying to do is search through a table according to what is selected on my form and delete the values that equal the value selected int the table. What I have so far is this

Private Sub cmdDel_Click()
Dim rsSource As DAO.Recordset
Dim rsDestination As DAO.Recordset
Dim theBug As String
Dim SelItm As Control
Set SelItm = Me.Users
If Me.Schedule.ItemsSelected.Count = 0 Then
Beep
Exit Sub
End If
Set rsDestination = _
CurrentDb.OpenRecordset("User_Course_Room", _
dbOpenDynaset)

For Each Itm In Me.Schedule.ItemsSelected
rsDestination.FindFirst "User_ID = " & Me.Users & "" And "Course_Room_ID = " & Me.Schedule.ItemData(Itm) & "" ### THIS LINE GIVES ME A ERROR
'rsDestination!Course_Room_ID = Me.Schedule.ItemData(Itm)
'rsDestination.FindFirst "Course_Room_ID = " & Me.Schedule.ItemData(Itm) & ""
rsDestination.Edit
rsDestination.Delete

Next Itm

Me.Sessions.Requery
Me.Schedule.Requery

End Sub

In the line with the bold writing next to it I get an error. What I am trying to do is search for the record with the user id selected and the course room id seleceted and delete that record but I get an error. Any help would be highly appreciated.

View Replies


ADVERTISEMENT

Urgent Help Needed

Jun 19, 2006

A record in a table linked to various others has recently been corrupted in my database. When i try to delete the record an error message appears telling me that the 'Search key was not found in any record' and the record will not be deleted. This corrupted record is causing me serious problems and i need rid of it by the end of the day.

Any suggestions would be greatly appreciated.

View 3 Replies View Related

Urgent Help Needed!!!

Jul 5, 2006

HI,

I am having a problem with all of my comment fields showing up as Japanese and I need to get some reports printed...
Does anyone know how or why this would or could happen?

I have checked the tables but they are normal. When you query the tables is when the comments start to mess up.

Thank you.

Your help is really appreciated!

View 7 Replies View Related

Urgent Help Needed

Nov 7, 2006

Hi,

I'm importing data of a query to excel from access; however, all fields that have combobox for input display numbers instead of text.

Any help will be very much appreciated.
B

View 4 Replies View Related

Urgent Help Needed!!!

Nov 14, 2007

Hello, I'm new to the board and I need an urgent problem fixed. Ok, I have a query that contains the type of TRAINING REQUIRED FOR EACH POSITION/PERSON IN A COMPANY . It has:-

1. Clock no. (uniqe for each employee)
2. Job Title
3. Position effective date
4. Training code
5. Description of training code
6. Retrain requirements ( number of days that are needed after initial training to reach retraining date, this varies from 0 to 365 days depending on the code)
7. Status of employee (whether active or inactive, the criteria for this is active)
8. Due date for completed training

I have another query which shows the TRAINING RECEIVED FOR EACH EMPLOYEE. IT has:-

1. Clock no.
2. Job title
3.Last names (employee)
4. First name
5. Status of employee
6. Training code
7. Date of training received

QUESTION IS HOW DO I CREATE I GUESS ANOTHER QUERY THAT WILL TELL ME WHAT REQUIRED TRAINING CODES THAT EACH EMPLOYEE HAS NOT RECEIVED? I BASICALLY NEED TO KNOW IF EVERY EMPLOYEE HAS BEEN TRAINED CORRECTLY ACCORDING TO THEIR POSITION OR NOT.

View 14 Replies View Related

Urgent Help Needed

Dec 25, 2007

I need to make a database for a association and collect the Business information and Personal information the following information is needed
For business
Business name
Corporation Name
Address
city
state
Zip Code
County
Phone
fax
then
Type
alcahol yes/no
tobacco yes/no
EIn number
STI Number
Sale tax Number

Personal

Name
Address
city
state
zip
phone
cell
email

*some things one owner might have more than one store.
i can make the form and everything just need help with relationships and that quiries that sort of stuff.

I am attaching a access 2007 file which i use.

View 6 Replies View Related

Urgent Help Needed

Apr 12, 2007

hi i am making a database for a company, in which i have the feild "joining date" and the feild "paymant method" which can either be yearly or half yearly

im looking for a quiery that will work out who need to pay when and also i need it to bring them up two weeks before due payment..... im then going to mailmerge them.. which i am not 100% sure how to do. :eek:

any help is highly appreciated :rolleyes:

View 5 Replies View Related

Urgent Help Needed

Mar 23, 2006

Hi,

I was wondering if anyone might be able to help me here. how do i stop the combobox to print multiple duplicate records?

for example,

in the combobox dropdown, there are records as follows
01
02
03
04
05
05
05
06
07

How do i ensure that it only displays the unique records only without printing 05 three times?

Your help is greatly appreciated.

Thank you very much

View 5 Replies View Related

Urgent Help Needed!!!

Apr 28, 2006

Hi. I am creating a website for my employees. I have created a table, query and a form in microsoft access containing a lot of different fields, including employee ID and password. I have also created a form in Dreamweaver. How do i link the database to the form and how do i create a code that will log in the employee if his password and username are correct, into a new page and if the info is wrong, to another page. PLEASE HELP. This is very very urgent!

View 4 Replies View Related

URGENT HELP NEEDED. VB Corrupt

Sep 25, 2006

Hi all,

Big problems on access 2003.

When opening my live db, the message

"The Visual Basic for applications project in the database is corrupt."

I've had a quick search but can't find a solution.
This db has always been access 2003 (Not converted from prior file version).
I can't even import into a blank db as the same error occurs.

HELP!

View 2 Replies View Related

Urgent Help Needed For New System

Jan 9, 2008

Hello all being my first post i will try and make this as clear as possible...

its a new system my company.

my manager would like if possible the system to work in this way..

firstly a form whcih will book rides so when opened will ask current members to etner their card no which is a 16 digit number always beggining with 5555 1946 and the customer no. added on which is 0000 0001.

If a customer has not registered another link so they can register and enter details and once done this press enter and message generating a new 16 digit card number 1 mroe than the highest number in the system. new members are allocated 2000 points on their card and points are taken off when booking new rides plus a 10 point booking fee.

then a button will be clicked to take back to reserve rides which allows the customer to book a ride using the ride id and ride number on a specific Session of which there are 3 times in the day 11:00, 14:00 and 17:00 and with a maximum of 5 places on each ride during each session being able to book.

once session ID and time,date selected the next box should show the available rides

if member does not have enough points to book an error message is displayed.

I know this all sounds confusing and ive attached my progress so far its very basic being a basic user i hope users out there can help as this has to be done before friday

the attachment is below thankyou for all the help

View 2 Replies View Related

Urgent Help Needed – I’m A Novice

Oct 11, 2005

Hi everyone,

Basicly I am doing an Access Project for my school coursework, but I am really confused and my teacher isn't that great.

My coursework is based on a video rental company.
The database (in breif) has to be able to bring up a customers details, and add a loan to/under that customers details. (as you would expect from a video shop).

Now, to be honest, I dont know if I have the correct items in each table, but was wondering if someone would be so kind to have a quick look to tell me what to change and where to put the relationships for the database to work correctly.

I have taken a screen shot of my current database:
http://img259.imageshack.us/img259/8216/accessproblem4de.th.jpg (http://img259.imageshack.us/my.php?image=accessproblem4de.jpg)

If you would like any other information, please let me know.
I am really grateful for this!

PS65

View 14 Replies View Related

Sum Not Working! (URGENT HELP NEEDED)

Oct 31, 2006

Hi,

I have used sum() function in a query where I have got other attributes. However, the sum() doesn't work for some reason.

I could not attach my database as its size is too big. i have uploaded it to this server where you can download it.
aimreda.co.uk/db (http://aimreda.co.uk/db)

Any help will be very much appreciated.

Regards,
B

View 9 Replies View Related

Query Needed Please Help Urgent

Feb 25, 2008

Original Table
ozip dzip shipdate wgt Transport cost

A B 12/1/07 20 450
C D 4/1/08 15 890
E F 9/1/08 78 750
A B 12/1/07 42 789
X Y 1/1/08 17 900
C D 4/1/08 34 90

Needed Output

ozip dzip shipdate wgt Transport cost

A B 12/1/07 20 450
A B 12/1/07 42 789
E F 9/1/08 78 750

I need to create a query which extracts rows with wgt >60 and also WHEN the fields ozip, dzip and shipdate are same, the query should add the wgts and then sum of wgts should be >60- for example the first and fifth rows should be extracted since sum is 62.

I have attached the output that is required for the above example. please help

View 1 Replies View Related

Urgent Help Needed In Formatting A Date??

Nov 16, 2005

I have a column called date, right now it is in m/dd/yyyy format and i want to convert this to dd-mmm-yyyy format how do i do this? thx for any help

View 1 Replies View Related

Urgent Help Needed With Table Create Query.

Aug 6, 2007

Hi all, i need some help constructing a query that will create a table for me that does not include the Type value of 'promotion' if the same ID value exists elsewhere within the query.For instance, in the example below, i would want to delete the first entry containing 'Promotion' because ID2001 exists in two other places. However, if only one instance of ID2001 'Promotion' existed in my query, i would want to keep that entry. I would prefer to write all my data to a new table called "Test", This query has to sort out about 1000 entries when executed, otherwise i'd do it manually.I'm pulling my hair out with this one, so could someone help me?ID Company Name TypeID2001 Disc plc John PromotionID2001 Disc plc Paul AgentID2001 Disc plc George Agent

View 3 Replies View Related

Urgent Required Field Advice Needed

Jul 1, 2005

I'm looking for advice on the best method to accomplish the following from the esteemed members of this Forum (You all have provided excellent advice in the past to this Access Dummy, with my thanks), (I've also searched the forums without result):

I would like to make several fields "required" fields on my form, easy enough, in that I set the Required property on the table to "Yes".

What I would like to happen on the form is that when a user tabs out of a required field, a message box pops up that says "This is a required field" and/or when they click any of the following command buttons I've created, "Save Record", "New Record" or "Close Form", that a message box pop up and list the required fields that they missed.

Any ideas, with code, macros, or other solutions would be greatly appreciated, keeping in mind that I'm just not that swift to start with.

Many Thanks,
Photoguy

View 9 Replies View Related

Urgent Help With Form Code Please

Sep 12, 2004

ok what follows is a kind of pseudocode of what I'm trying to do. It would really help if someone could tell me how to get a command button to do the following startin by the copying of fields into a new record in a table and then using that table to do the required actions. Any help would be greatly appreciated and yes it is urgent as the assignment is due in on Wednesday.

Copy fields into new record in table Transactions
If [Transaction.In or Out] = In Then

[Items.Current Qty] (for specified Part No.) = [Items.Current Qty] + [Transaction.Qty]

(Add new record to Purchase Orders Table)

[Purchase Orders.Purchase Order No] = [Transaction.From/To]

[Purchase Orders.Part No] = [Transaction.Part No]

End If

If [Transaction.In or Out] = Out Then

[Items.Current Qty] = [Items.Current Qty] – [Transaction.Qty]

(Add new record to Sales Orders)

[Sales Orders.Part No] = [Transaction.Part No.]

[Sales Orders.Sales Order No.] = [Transaction.From/To]

End If

View 1 Replies View Related

Code Not Working Properly..urgent Pls.

Apr 17, 2006

Hi All,

I have Header form and subform subform in it with following fields

Subform fields are :

1. MQE_No : (Text field as it will be like MG-120, MG230), Duplicate OK)
2. RPO_No : (Number field – Double, Duplicate OK ) The are project no.
3. ForemanNo (Number field – Long Int – Duplicate OK)

Header form fields are ;

1.ForemanNo – Long Int – No Duplicate
2.Other fields…

The subform field have ForemanNo One-To-many relationship with Header form.

Following project MG-411 need to enter (assign) to foreman no. 641

Actual data to store in subform

MG-411 (MQE_NO)
5421654 (RPO_NO)
641 (FOREMANNO)

I started to enter data into subform selecting the ForemanNo at header so records to enter in specific foremans account. Everything is fine here.

What I need is:

I would like to select / add another Foreman into the header and start entering same above data for another Foreman. Bcz sometimes we need to do like this in case previous Foreman may go on to a week vacation. We can not stop project for a week. So need to assign project to other foreman.

When selected the Project (MG-411) thru a combo to assign it with other foreman, it should give a short msg to user that this project has already been assigned to “XYZ” forman. Need to assign again “ (Y/N box )

If Y then data entered otherwise cancelled.

To achieve this, I did the following but only 50% success. (Used Cmbo CboRPO2 select MQE_NO). Tried to satisfy both condition but no use.

Private Sub CboRPO_AfterUpdate()
If DCount("*", "T_RPO_Footer", "RPO_No = " & RPO_No) > 0 And DCount("*", "T_RPO_Footer", "ENO = " & ENO) Then
MsgBox "RPO ALREADY ASSIGNED TO SOMEONE / FOREMAN", vbOKCancel, "WARNING!!!"
Me.Undo
Exit Sub
Else

Dim Msg, STYLE, TITLE, HELP, CTXT, Response, MYSTRING
If DCount("*", "T_RPO_Footer", "RPO_No = " & RPO_No) > 0 And DCount("*", "T_RPO_Footer", "ENO <> " & ENO) Then
Msg = "RPO ALREADY EXIST WITH OTHERFOREMAN, ASSIGN AGAIN TO ANOTHER ?"
STYLE = vbYesNo + vbInformation + vbDefaultButton2
TITLE = "!! ATTENTION !!"
HELP = "TEST FILE"
CTXT = 1000
Response = MsgBox(Msg, STYLE, TITLE, HELP, CTXT)

If Response = vbYes Then

Me.MQE_NO = Me.CboRPO.Column(0)
Me.RPO_No = Me.CboRPO.Column(1)
Me.WORKSHEET_NO = Me.CboRPO.Column(2)
Me.WORKORDER_NO = Me.CboRPO.Column(3)
Me.WORK_DESC = Me.CboRPO.Column(4)
Me.PL = Me.CboRPO.Column(5)
Me.PipeLineKM = Me.CboRPO.Column(6)
Me.DiaMeter = Me.CboRPO.Column(7)
Me.PipeLength = Me.CboRPO.Column(8)
Me.PipeLineArea = Me.CboRPO.Column(9)
Me.P = Me.CboRPO.Column(10)
Me.RPO_AMOUNT = Me.CboRPO.Column(12)
Me.INV_AMOUNT = Me.CboRPO.Column(13)
Me.Status = "WIP"
Me.StatusID = 2
Me.CboStatus.SetFocus
Else
Me.Undo
Exit Sub
End If

Else
Me.MQE_NO = Me.CboRPO.Column(0)
Me.RPO_No = Me.CboRPO.Column(1)
Me.WORKSHEET_NO = Me.CboRPO.Column(2)
Me.WORKORDER_NO = Me.CboRPO.Column(3)
Me.WORK_DESC = Me.CboRPO.Column(4)
Me.PL = Me.CboRPO.Column(5)
Me.PipeLineKM = Me.CboRPO.Column(6)
Me.DiaMeter = Me.CboRPO.Column(7)
Me.PipeLength = Me.CboRPO.Column(8)
Me.PipeLineArea = Me.CboRPO.Column(9)
Me.P = Me.CboRPO.Column(10)
Me.RPO_AMOUNT = Me.CboRPO.Column(12)
Me.INV_AMOUNT = Me.CboRPO.Column(13)
Me.Status = "WIP"
Me.StatusID = 2
Me.CboStatus.SetFocus
End If
End If
End Sub


I tried with following code also

'Dim cdn As String
'cdn = "[MQE_NO] = '" & Nz(CboRPO, "") & "'"
'cdn = cdn & " And ENO = " & ENO

'If DCount("*", "T_RPO_Footer", cdn) > 0 Then
'MsgBox "THIS RPO ALREADY ASSIGNED TO THIS FOREMAN", vbOKOnly, "WARNING!!!"
'Me.Undo
'Exit Sub
'Else
‘do something
‘End if

Can somebody help it please.

With kind regards,
Ashfaque

View 1 Replies View Related

Code Help Needed On Message Box Please

Apr 30, 2007

Hi All, Is it possible to have just one instance of this message box fire when one or all or any number of the flags are triggered. At the moment if 2 flags are set then 2 messgage boxes appear,if 3 then 3 messages etc. My code at the moment is below to trigger the message box, hope I make my self clear;can it be tidied up?





private Sub Form_Current()
If Me.Flag1 = "Patient Alert. HIGH RISK. Med Hist" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
If Me.Flag2 = "Patient Alert. ALLERGY. Med Cond" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
If Me.Flag3 = "Patient Alert. Cat Score. LOW. Caution See Notes" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
If Me.Flag4 = "Patient Alert. PATHOLOGY. Int/Ext Exam" Then
MsgBox "**WARNING PATIENT ALERTS DETECTED**Read all patient alerts before treatment"
End If
End Sub

View 9 Replies View Related

Help On Message Box Code Needed

May 9, 2007

Hi All,:confused: need some code help again, I dont seem to be able to get the hang of message boxes!! The code below takes the path to a mdb file which is stored in a text box on my form, it then deletes an existing table -Expire-and replaces it with a new table also called Expire from the database located at the file path in the text box.

Private Sub Command6_Click()
Dim tmpFilePath As String
tmpFilePath = Me!Text1

DoCmd.DeleteObject acTable, "Expire"
DoCmd.TransferDatabase acImport, "Microsoft Access", tmpFilePath, acTable, "Expire", "Expire", False
DoCmd.Close

End Sub


What I would like to happen is; when the process has finished a message box pops up and informs the user that:

"the update has been successfull, your DentureBase V2 licence key has been updated"

the form then closes. If it is at all possible I would then like the db to close and restart (but this is not essential).

Once again I appeal to your generousity, many thanks:D

View 3 Replies View Related

Nearly There Just One Line Of Code Needed...

Mar 12, 2008

Hi All

I have the following code and wish to change the Weights.Collected field to True from false in the new query (expr3: ) in the new query.

Thanks



Private Sub cmdBuildQuery_Click()
On Error GoTo Err_BuildQry
Dim strSQL As String
Dim qdf As DAO.querydef
strSQL = "SELECT TOP "
strSQL = strSQL & Me.txtNumberToGet
strSQL = strSQL & " weights.Weights, Weights.DocketNo, Weights.Collected, Weights.UKBulk, Weights.weighttime FROM CollectionQry "
strSQL = strSQL & "ORDER BY ([id]);"

DoCmd.DeleteObject acQuery, "qryCollectYorks"

CurrentDb.CreateQueryDef "qryCollectYorks", strSQL

DoCmd.OpenQuery "appendUkBulk"
DoCmd.OpenQuery "qryCollectYorks"
Exit_BuildQry:
Exit Sub
Err_BuildQry:
If Err.Number = 7874 Then
Resume Next
Else
MsgBox Err.Number & " - " & Err.Description
Resume Exit_BuildQry
End If
End Sub

View 7 Replies View Related

Desperately Needed Code

Dec 28, 2004

Hi,
I have a database that has a combined user last name, user first name and user middle initial all in one field called name.

Example:

NAME
DOE JOHN I.
SMITH JOHN R.

I would like to get a code that will look at the field and separate them in three different fields, such as :

LNAME
DOE
SMITH

FNAME
JOHN
JOHN

MI
I.
R.


I would really appreciate any help.

Sincerely,
Monti

View 2 Replies View Related

Need Help, Urgent. :)

Jul 13, 2006

I have a database of employees, sales, products(Sky and Mobile Phone Contracts) and customers(Need to be common and shared between all products). ( A door-to-door marketing company)

Since each product requires different inputting tables, I have inserted all the required fields into the tblSales and then I want to run a query in order to select the needed fields and create a new Sale of a specific product.

However at the same time I want to create a new customer, assign the sale to an employee, select the commission ID that he is going to receive for the job... etc. Well as you can see the problem is that it is not letting me do it due to the fact that an entry is missing in the other table for that client or a client is not yet created for the sale. (Only one autonumber is assigned.)

What am I doing wrong?

Just in case you want to look at my mess... I have attached the DB :P

View 2 Replies View Related

Urgent Help!!

Mar 16, 2007

Hello,
I have the following "range" table. I have a "txtBoxA" (numeric) and "txtBoxPrice". I have to look in the table for the corresponding range of "txtBoxA" and retrieve the VALUE for that range and store it in "txtBoxPrice"

LOW HIGH VALUE
1 500 40
501 1,000 70
1,001 2,500 90

Example: "txtBoxA" = 200 then the corresponding VALUE would be 40 and I would have to store 40 in "txtBoxPrice"

How would I do this??
I'm doing this in ACCESS
Thank you

View 1 Replies View Related

Urgent Help Please

Apr 5, 2007

My school coursework database is on my memory stick, and i have just opened it, and all my forms, reports and marcos have gone. The file has gone from 12000kb to 10000kb, and a table MSysCompactError automatically created itself. How can i get it all back?????
The last time i accessed the memory stick was on the school PC.

http://img485.imageshack.us/img485/1139/errorzm6.jpg

View 1 Replies View Related







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