How To Assign A Row A Number? Help Please!

Jan 12, 2006

Hello! I'm trying to assign a number to a set of rows so I can, essentially, create a dual primary key on a table. Below is an example of what I have...

654321 | Course 1
654321 | Course 2
123456 | Course 1
123456 | Course 2
123456 | Course 3
123456 | Course 4
123456 | Course 5

The numbers are just "student numbers" if you will. Something that identifies them. The second column is basically the name of a course. What I would like to do is number each row, but only within the group of that individual.

Example:

1 | 654321 | Course 1
2 | 654321 | Course 2
1 | 123456 | Course 1
2 | 123456 | Course 2
3 | 123456 | Course 3
4 | 123456 | Course 4
5 | 123456 | Course 5

Can I accomplish this?

View Replies


ADVERTISEMENT

Forms :: Assign Next Number To A Field Not Using Autonumber

Apr 24, 2014

Auto number will not work for what I want to do. I am creating a simple database that will assign the user with the next incremental number in a field. The intent of the database is for the user to enter three text fields and then obtain the number. I believe that Dmax would work but do not know how to make populate the table.

View 10 Replies View Related

Forms :: Way To Assign By Design Certain Item Number To Given Control?

May 12, 2015

The code I am modifying looping through Me.controls collection to identify appropriate control types. Is there a way to influence the order (sequence) of that traversing? Or in different words, is there a way to assign by design certain item number to a given control?

View 4 Replies View Related

Assign Incrementing Number Based On Common Field

Apr 16, 2013

My access database is used to process vehicle trips. Each shift, a vehicle is assigned a docket number (paper based), and on this docket the driver fills out each trip he/she makes. In a shift (thus on a docket) there may be 5 - 15 trips. I want to create an incrementing number for each trip in a new field - can be created as they are processed or after the fact by looping through the resultant data - whatever is easier.

So in simple terms, return all trips for each docket number then number each trip.

View 5 Replies View Related

Forms :: Hex Number Conversion - Assign Back Color To A Control

Aug 9, 2014

I'm using Access 2010

What I want to be able to do is to assign a back colour to a control from VBA. There are many colours and what I thought would be an easy process was to choose a suitable colour to be assigned using the colour picker for a control, note the hex number then in my vba code would be

if... then me.mycontrol.backcolor=&HF0AD34

This compiles OK, but produces a completely different colour - I'm expecting an orange colour but getting blue and in another example a pale blue is coming out a brown.

Research indicates adding an ampersand to the end changes the value from integer to long but if I type

if... then me.mycontrol.backcolor=&HF0AD34&

The second ampersand disappears. In the immediate window

?&HF0AD34
?&HF0AD34&
?Val("&HF0AD34")
?clng("&HF0AD34")
?Val("&HF0AD34&")
?clng("&HF0AD34&")

All produce the same value of 15772980, which if I copy back to the control backcolour property produces the blue colour and not the required orange - which if i debug.print me.mycontrol.backcolor give me 3452400 - the correct number for orange.

The problem seems to be converting the hex number to a long.

Also how to modify the properties window to show the decimal value rather than the hex value, but can't see anywhere to do this.

View 14 Replies View Related

Queries :: Auto Assign Increasing Number Based On Multiple Factors

Jun 11, 2015

I have written a check writer program for the company I work at. I have a table for Venders, and a separate table Invoices set with a 1-many relationship. When checks are printed it consolidates all the unpaid invoices for each vender to print a single check and mark it as paid with the date.

The checks already have a check number printed on them so what I need is an option that will allow me to enter the first check number when the print starts and Access will put that number in a field on the invoices page for each invoice associated with the first vender printed, then would increase the number by one and put that number in the invoices associated with the next vender printed.

View 5 Replies View Related

Can't Assign Value To Object

Apr 14, 2006

I keep getting this message when I try and input a product ID in the subform in my 'Order Form', the message says 'you can't assign a value to this object' and when i try to click the row below it says 'You cannot add or change a record because a related record is required in table 'Invoices'', how can I change this? do i have to relate it to the Products table and if so how do i do this? Thanks, Bob.

System Link:
Gamez System (http://www.savefile.com/files/5147388)

View 1 Replies View Related

Assign Value To Label

Apr 20, 2006

hi

in vba i done a query
strQuery
strQuery = "select sum(x) as X, sum(y) as Y from test3"

how to run this query and get sum(x) value, sum(y) value and
set it to label

txtX.caption = ...
txtYCaption = ...

any idea?

thanks

View 1 Replies View Related

Assign Variable From SQL

Dec 28, 2005

I have a table set up like this:

tbl_original
account, invoice
11111, 1
22222, 1
33333, 5
44444, 3

I want to create a function module or something similar which will assign a variable to the max invoice # used on that table, using sql if possible. I tried something like this, but it's not working.

Public Function max()

Dim maxinvoice As String

maxinvoice = "SELECT Max(tbl_original.invoice) AS MaxOfinvoice" & _
"FROM tbl_original;"

MsgBox maxinvoice

End Function

I would like the msgbox to popup saying "5", since that is the max invoice # used based on the above table.

I don't have too much experience using modules on their own without forms and variables on the form to assign to, can someone make a suggestion?

Thanks in advance!

Vassago

View 14 Replies View Related

Assign A Value Automatically

Apr 17, 2008

Hi Im making a database with a form,

The thing that I dont know is how to do this:
I have two fields in the table , one is a text and the other is YES/No

I want that in a form, I will use a barcode when The value was enter in the form automatically the assign YES in the other field and save it

I need help urgent

View 3 Replies View Related

Assign Default Value

Jan 21, 2006

See Attached database

I have a frm called frmaddprovider Main form see database
I Also i have subform called frmsubformproviderids with
2 command buttons Add Provider ID and Refresh data

When i generate a report by selecting insurance name, insurance id, from the table called tbladdinsurance and also select Provider, Pin from the table called tblproviderids

When i generate the report as you can see by the sample database only insurances that are selected in the combo box shows up

How do I assign a default value so if the insurance combo box in the subform field is left blank it will automatically assign the Pin# to all insurances and when i generate the report it will show all insurances along with provider and Pin#

View 4 Replies View Related

Can't Assign Value To An Object

Mar 19, 2006

I keep getting this message when I try and input a product ID in the subform in my 'Order Form', the message says 'you can't assign a value to this object' please have a look at it, thanks.
Gamez System (http://www.savefile.com/files/4823667)

View 1 Replies View Related

Can't Assign A Value To This Object

Mar 27, 2006

Greetings, all.
Run into a snag with a payroll db, appreciate any help you can give me.

Main Form, with ordinary payroll/personnel info--clock no, first and last names, S.S.no., etc.
Subform for entering regular hours worked, OT hours worked, etc per Period Ending, keyed to main form by SS no. Pretty basic stuff.

Problem is, when we try to enter the first data in the subform, we get this error message :
"You can't assign a value to this object.
*The object may be a control on a read-only form.
*The object may be on a form that is open in Design view.
*The value may be too large for this field."


We get the message in the first field we go to, no matter which field we go to first.
None of the "may be" conditions apply.

When we hit "OK" the message goes away and we can enter our data, the records are created corrected. But as soon as we move to the next record, we get the same error.

Any idea why we're getting this error message?

Thanks for looking,
BeckieO

View 1 Replies View Related

Using VBA To Assign Value To Control

Aug 18, 2006

I have been pulling my hair out (OK, I would be if I had enough to do so) over trying to assign a value to a control on a form. Basically, when a change is made to the form, I'm using the AfterUpdate event to trigger the code. The code in the event is

Me.txtWho = Environ("UserName")

Simple, straightforward or so I thought. Problem is, it gives me an error stating I cant' assign a value to that object. txtWho is bound to a field in the query underlying the form and the control is enabled and not locked. Can anyone shed some light on this for me please????

View 13 Replies View Related

Assign PO #'s In Batches??

Aug 1, 2007

Hi, all! I'm working on another project and need some advice.

I've got a form where users enter items that will be listed in a budget report. This budget report is submitted to the client for approval. Once approved, these items need to be entered into a PO (purchase order) form and report. There is a checkbox that says approved for PO on the budget form for each record.

What I'm looking for is a way to group the records (that have been approved for purchase) together by vendor, and assign them PO #'s. I know that the end result will be doing an append query that will throw all the records into the PO table, but I don't know how to get the grouping and everything to work.

Does this question make sense? If not, please let me know what info you need. I really need help with this. Any ideas? Thanks!

KellyJo

View 1 Replies View Related

Cannot Assign A Variable

Nov 7, 2007

I have a simple combo box with two options - elective and emergency. They are set up on a continuous form.
When i try to choose a value it comes up with the message "You cannot assign a value to this object". I have checked the three criteria it mentions, object being on a form open in design view (no), value too large for field (no - text field with (defaulted) size of 50), control on a read -only form (no, form is editable).
The strange thing is as soon as you clear the error message box it lets you enter the value anyway.
Any ideas?

View 2 Replies View Related

Assign Default Values

May 16, 2006

Hi, in my database I have a 7 subforms that shows fields for daily tasks for each day of the week. On the Monday, the tasks are assigned and then stored for every record for the corresponding date. The process is done again on tuesday, then wednesday etc. However, often the daily tasks for say tuesday will be very similar (sometimes the same) to that of monday's.

Therefore is there a way to set the default values for each day as the previous days tasks and then alter them if needed?

Thanks for helping!:o

View 1 Replies View Related

Automatically Assign Primary Key

Aug 15, 2005

Hi

I've compiled a make table query and would really be happy if I could automatically assign a primary key to one of the fields i.e account ref.

Any ideas, suggestions gratefully appreciated

Cheers
paul

View 1 Replies View Related

Assign Two Primary Keys

Jul 31, 2007

SOLVED: Hows it goin?I need to assign a second primary key to a table involving three fields (Student Number, Subject Code and Average). I have to make Student Number and Subject code the primary keys. Any help would be appriciated.

View 6 Replies View Related

Assign The Value At Run Time In SQL Query

Aug 28, 2007

hi..

i want to use this query into my code..

DoCmd.RunSQL "INSERT INTO joint_ledger (owner_ref, value_settled, ClientONo, trans_against, con_veh,) VALUES (" & G_current_client & "," & (G_value_os = 0) & " , '" & G_clientono & "', " & jjref & ",'" & con & "')

the part of statement highlighted in red ...is the value for the filed value_settled whose data type is yes/no..

now i am confused with thise highlighted part..will it assign the 0 to G_value_os or first use the original value of G_value_os to insert the value into database... please help me...

many thanks...

View 4 Replies View Related

Error - You Can't Assign A Value To This Object

Jul 7, 2006

I have searched the forums and I don't see this problem. I have a split database. When I test it it works fine. It resides on a network drives and permissions have been checked. When users try it they get an error message that says "you can't assign a value to this object". This occurs after they have selected a project and the user form opens. The user form appears blank.

I have gone to other offices and if I am signed on to their machines it works but if they are the message comes up. I'm at a complete loss and need some advice. It's probably as plain as the nose on my face but I've been struggling for days.

By the way - I used to be Mrs.Meeker...I haven't been around for a long time.

View 1 Replies View Related

Problem To Assign A Query

Aug 8, 2006

hi

i created a query named: qryTest

on a form, i put a subform/subreport (name: resultQuery)

i have also a button

when i click on the button, i would like to run my query: qryTest and i want to display the result to my component: resultQuery

i tried

resultQuerysourceobject = currentdb.querrydefs("qryTest");

i get error syntax....

any idea?

thanks

View 4 Replies View Related

Assign A Barcode To A Material

Sep 21, 2006

Hi Guys,

I've tried searching the forum to no avail,
I have a table (tblBarcodes) that has two fields, Barcode & Material
The Barcode field is already populated with specific numbers, but what I need to do is when I enter a new material on my form it will assign it a barcode from the tblBarcode and then append the Material code to the that table against the relevant record.

Is this possible?
Thanks again

View 1 Replies View Related

Assign A Record To A Table

Dec 6, 2006

I was wondering if anyone could help me with a problem I'm having with a form...

I have 2 tables, one called 'dept' and the other called 'employee.' These tables have a one-to-many relationship; basically, one department to many employees.

Instead of using a combo box, how do I assign an employee (employee_table) to a department (dept_table) by simply selecting a checkbox on a tabular (employee) form and the record is automatically added to the dept table?

I would greatly appreciate any help. Thank you!!!

View 5 Replies View Related

Queries :: Assign Value Of Row Counter?

Oct 1, 2013

I have an export query that has number of distribution and CM distribution for invoices generated. The objective is to count the number of invoices based on the account number for each customer ID. Since the table has no primary key, the I assigned field number of distribution to 0 in hopes the counter will assign the value of the row number. The attached file shows how the current export displays and how it should display in the highlighted correct way section. I tried COUNT and DCOUNT methods which is the current setup, and they aren't working. This will eliminate the need to go into the file and change the 2 fields.

View 2 Replies View Related

Modules & VBA :: Can't Assign A Value To Object

Nov 15, 2013

I am trying to use Access 2007 popup calendar to populate a combo box with a selected date. When I select the date on the calendar the above error appears.

Code:

Private Sub Calendar9_Click()
'Set Date to the selected date and hide the clalendar.
MAssBDate.Value = Calendar9.Value
MAssBDate.SetFocus
Calendar9.Visible = False
End Sub

[code]....

View 2 Replies View Related







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