I tried to append one record to the end of the table (as end-of-the file indicator) but it's appending multiple records. Here is the code I have used to,
Table Name : MyTable
DoCmd.RunSQL "INSERT INTO MyTable (eof-Indicator) SELECT 'eof-101'
along with data in each row, i want to include the record number in the ouput of a query. is it possible?
once i run the query and view the ouput, i can see the standard access database record counter at the bottom or if i select a row, i can see the row number at the bottom.
how can i include that counter in each row of output from the query?
I got a easy table with two columns. To make it easy say
1 20 2 40 3 30 4 78 5 60 6 85 7 20
I want to put the number 1 - 7 over a picture and get it to look up the value in the 2nd coloumn and replace the nr with the number in the 2nd column. Is this possible? I would have to manually put in where 1 - 7 is (this will be labeled ontop of a plot plan)...
I've created several expressions in a query to test for values in a field (one column for each value for use in a report).
The expressions output the value 1 where the test is true. I planned to sum them to establish how many times the value is true but this isn't working. I am only offered a Count and this returns the number of records. Other fields (numeric) are offering me a sum at the total line and are working as expected.
I assume the expressions are outputting the value one as text rather than as a number but I can't work out how to change this.
I've been working on creating a database for a Physical Therapist that will store patients information and information on past appointments (including the amount of money paid per appointment). I created a form that he can then easily select the patient and their D.O.B. and insurance carrier will show up.
But I need to create a way that when he then selects the treatment received for the appointment that the correct payment amount will show up and be recorded as well. The reason this is an issue is because for each insurance there is a different cost per treatment.
I'm currently setting up a data base in which I want to store price with a Japanese Yen Currency indicator. Is this possible? The Format allows for either Dollars or Euro. I like to use preferably ¥ or JPY as the currency indicator.
Hi :) Just registered and was wondering if anyone could help me out.
I have a very simple table for which I am making a form. The table has two values:
'Week Number' (Number) and 'Period' (Number)
What I need is for the 'Period' field to increment with every new record created (easy enough) but when the week number changes I would like the 'Period' number to reset back to 1 in the following fashion:
I just noticed something very strange - in a table of mine, when I create a new record with the form, the autonumber is an existing number. Say the last record had ID 400, then the "new" record is assigned an autonumber ID of 300. Of course, record creation fails that way. But with every attempt, the new autonumber moves one up, so eventually it'll start making unique numbers again.
Does anybody have an explanation for this odd behaviour?
Ok, so while working on my program, i was trying to integrate inventory control with job ordering. i finally got it to work, but encountered a 2hr speedbump along the way. here's what happened:
i had 2 numbers: varQuantity and varStock (quantity being the amount to be ordered, stock being the amount in stock). i wanted code to run telling the orderer that we didn't have enough in stock if varQuantity > varStock. so, after entering test data (100 for stock, 200 for quantity) to see if the code would run, it didn't. going back through, i tried to see if i did something wrong, entered a > or < sign backwards, whatever. nothing.
If varQuantity > varStock Then do this else do this end if
it totally skipped this bit of code. i placed msgboxes between the steps to see where the problem was occurring, and only the boxes before and after the code functioned. i then placed a msgbox directly before the If statement with this prompt:
guess what i got? you'll laugh. 200 > 100 = False. Now tell me what i'm supposed to do when my computer can't tell when 1 number is bigger than another? i tried different test data, i made sure that my fields were of the same data type, etc. nothing. how do i proceed?
well, the solution i came across worked, but i'd like to know why. varStock = varStock * 1. why does this work? maybe i'll never know. Stupid computers.
I have a form with more records lines. For each record I have a button what will open a specific file if exist.
Dim strFoldername As String strFoldername = Me.Scan If Dir("M:Applications AccessCredit autorisationsDocuments" & strFoldername, vbDirectory) = "" Then MsgBox "Missing document" Else FollowHyperlink "M:Applications AccessCredit autorisationsDocuments" & strFoldername End If
To verify if the file exist, instate to press the button, I like to indicate on a new field [Ctrl_Doc], the presence of respective file. (Ex: True or False). I tried this, but doesnt work:
Private Sub Form_Load() If Len(Dir("M:Applications AccessCredit autorisationsDocuments" & strFoldername, vbDirectory) >0) Then [Ctrl_Doc]= True Else [Ctrl_Doc]= False End If
Whenever I export reports to PDF, the output appears zoomed and clipped. No extra pages are generated as they would be if I'm going over margins, it's just the report is clipped.
The report looks perfect in preview mode, and it looks perfect when going to an actual printer. However, when using OutputTo to save it as a PDF, this is when the report content is clipped.
I open the report in preview mode first so events are fired that show/hide various objects based on fields in the recordset.
I've tried reinstalling, and I've tried this on two different machines, one running Windows 7 and one running Windows Server 2008...both with the same results.
I would like to know if there is any procedure to restrict/stop auto number increment for certain number of record count (say 50), then increment by 1 for next 50 records.
create a macro that automatically fills in the next invoice number in sequence",,I'm assuming this macro would look at the value of the previous record and add a one to itI don't want to use a AutoNumber field as I might need
I have a main form and a sub form. when a record is clicked on the sub form I would like to change a textbox on the main form to say "You are on record number 8 of 10.
Do you have any idea's how I can tell what record number they are on;-
Is there any way that I can set the default value of a text box on a form to be what its record number is for that specific form? Basically I want the default value to be the number that shows on the bottom of the form in the navigation section. Thanks for the help.
Rather than using the 'Navigation' offered by MS Access I would like to have 2 text boxes, one that shows the total number of records in a recordset (DCOUNT works here) and one that shows the number of the current record, incrementing or decrementing as I click on the 'Next' and 'Previous' command buttons. Does anyone know if there is there a function that does this?
I have a table, tblEvents, which I use to store information about a meeting, training session or field trip, including the [StartDate]. I also have a table, tblEventDays, which I use to store the [DayNumber] 1, 2, 3... At the moment I have to enter the day numbers in the subform frmEventDays manually, but I would like to add button controls to increase/decrease the number of days for each event (i.e. add a new record where [DayNumber] is incremented by 1, and delete the last record if I have added too many day records).
I have added button controls to my EventDays subform and managed to use the macro builder to select and duplicate the last [DayNumber] record, but cannot figure out how to increase each successive [DayNumber] by 1.
1. Add a day...
Option Compare Database Private Sub AddDay_Click() ? End Sub
2. Remove a day...
Option Compare Database Private Sub RemoveLastDay_Click() ? End Sub
I need to track employee training hours and employee backfill hours. I will need to see which employee was training, and the employee who filled in for him. Both will have the same info. Is there a way to use two tables on one form, and keep the record number the same in each table? I would need to be able to match the data in table 1 to the data in table 2 by record number. I thought about one giant table, but I think it may get really confusing. Any ideas?
HeyI'm trying to create a Library database. This involves restricting the number of loans available to each member (currently 3). I need to make it so no more than 3 records exist in that table for each member. For now ive just entered a VB script that has a message box saying not to enter more than 3 loans per person but I dont think thatll be enough, I need some sort of validation for the whole table rather than a field.I know how to limit the returns of sql queries which is all I can find, but not how to limit the actual amount of entries. The loan table is part of a double query within a subform of the member form if it helps :s
If I have an unbound text box (Number of Episodes) with a control source =Count[(UR]) how can I make the form open to the highest number. (ie if a person has two episodes how can i get the form to open to the second one?)
I ran into a weird task, sometimes at my job we have to use 3 identicle records where just one thing changes and that is the date. The thing that is giving me a problem is I get an error if I try to duplicate the record due to primary key being duplicated. I have a ID field which gives all records a number and when I try to duplicate the record I am in, I get an error because of the duplication of the ID Field. Is there a way to get around this?