Hi Every1
I have only just started working on databases very recently - and I am not at the technical stage yet either.
I am creating a database to integrate into sage line 50. This bit is fine, its the "user friendly" side I'm having trouble with.
I have a form with the main invoice details (which is a sub form on the customer account). I need another form to enter the invoice message and breakdown of materials and labour. I would like to add a button on the subform to open a new form but to have already entered the invoice number.
I have tried already the microsoft built in options, but that only appears to work for data which has already been entered.
I would be grately appreciative if anyone could help.
Thanks
Dan
17 1940
Hi Every1
I have only just started working on databases very recently - and I am not at the technical stage yet either.
I am creating a database to integrate into sage line 50. This bit is fine, its the "user friendly" side I'm having trouble with.
I have a form with the main invoice details (which is a sub form on the customer account). I need another form to enter the invoice message and breakdown of materials and labour. I would like to add a button on the subform to open a new form but to have already entered the invoice number.
I have tried already the microsoft built in options, but that only appears to work for data which has already been entered.
I would be grately appreciative if anyone could help.
Thanks
Dan
Hi!
Let me straight it out. The form is opened incorrectly only on a record you've just entered, there is no problem with records entered previously. This is completely normal situation bcz Access saves new record when you move to another one or a form looses focus.
If so, the cure is easy. Just add - DoCmd.RunCommand acCmdSaveRecord
before DoCmd.OpenForm ... in button_click sub.
Hi There,
Unfotunately not. Just to clarify I have 3 tables
* Invoice (Main details that I export to Sage)
* Invoice Details (main text string)
* Invoice Breakdown
These are all linked by the invoice number. I have created a form with the account details, and as a subform from that has the main invoice details. In the subform I have added a button using the access wizards to open a form (invoice details and invoice breakdown as a subform). But it does not link the invoice to the invoice details form.
Thanks for your help with this!
Dan
Hi There,
Unfotunately not. Just to clarify I have 3 tables
* Invoice (Main details that I export to Sage)
* Invoice Details (main text string)
* Invoice Breakdown
These are all linked by the invoice number. I have created a form with the account details, and as a subform from that has the main invoice details. In the subform I have added a button using the access wizards to open a form (invoice details and invoice breakdown as a subform). But it does not link the invoice to the invoice details form.
Thanks for your help with this!
Dan
Plz post the sub handling button_click event.
Plz post the sub handling button_click event.
- Private Sub Command23_Click()
-
On Error GoTo Err_Command23_Click
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
stDocName = "002b Transaction Details"
-
stLinkCriteria = "[Invoice Ref]=" & "'" & Me![Invoice No] & "'"
-
DoCmd.OpenForm stDocName, , , stLinkCriteria
-
Exit_Command23_Click:
-
Exit Sub
-
Err_Command23_Click:
-
MsgBox Err.Description
-
Resume Exit_Command23_Click
-
End Sub
- Private Sub Command23_Click()
-
On Error GoTo Err_Command23_Click
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
stDocName = "002b Transaction Details"
-
stLinkCriteria = "[Invoice Ref]=" & "'" & Me![Invoice No] & "'"
-
DoCmd.OpenForm stDocName, , , stLinkCriteria
-
Exit_Command23_Click:
-
Exit Sub
-
Err_Command23_Click:
-
MsgBox Err.Description
-
Resume Exit_Command23_Click
-
End Sub
Is [Invoice No] text type field in table?
Is [Invoice No] text type field in table?
Yes, the invoice number is manually entered. This links the two tables 001 Transaction Details (Invoice data to sage) and 002 Transaction Details (Invoice Breakdown)
Yes, the invoice number is manually entered. This links the two tables 001 Transaction Details (Invoice data to sage) and 002 Transaction Details (Invoice Breakdown)
This definitely should work. Tell me please what you've actually meant in msg#1 ?
I have tried already the microsoft built in options, but that only appears to work for data which has already been entered.
Does this mean that problem occurs with new entries only?
Just to make a sence.
This definitely should work. Tell me please what you've actually meant in msg#1 ?
Does this mean that problem occurs with new entries only?
Just to make a sence.
Sorry, I'm quite confused with all this!
On opening the new form and entering information. The info goes into the new table but not in the connecting fields ie the invoice number.
The fields are there with the information, but on re-opening the form it does not show relevant data because it isnt automatically updating the invoice number in the next table.
Ok. Sorry, I had to realize it from the very beginning. Try the following code. - Private Sub Command23_Click()
-
-
On Error GoTo Err_Command23_Click
-
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "002b Transaction Details"
-
stLinkCriteria = "[Invoice Ref]=" & "'" & Me![Invoice No] & "'"
-
-
With DoCmd
-
.RunCommand acCmdSaveRecord
-
.OpenForm stDocName, , , stLinkCriteria
-
End With
-
-
Forms![002b Transaction Details]![Invoice Ref].DefaultValue = Me![Invoice No]
-
' Assuming form [002b Transaction Details]
-
' has control named [Invoice Ref] bound to [Invoice Ref] table field
-
-
Exit_Command23_Click:
-
Exit Sub
-
Err_Command23_Click:
-
MsgBox Err.Description
-
Resume Exit_Command23_Click
-
-
End Sub
Ok. Sorry, I had to realize it from the very beginning. Try the following code. - Private Sub Command23_Click()
-
-
On Error GoTo Err_Command23_Click
-
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "002b Transaction Details"
-
stLinkCriteria = "[Invoice Ref]=" & "'" & Me![Invoice No] & "'"
-
-
With DoCmd
-
.RunCommand acCmdSaveRecord
-
.OpenForm stDocName, , , stLinkCriteria
-
End With
-
-
Forms![002b Transaction Details]![Invoice Ref].DefaultValue = Me![Invoice No]
-
' Assuming form [002b Transaction Details]
-
' has control named [Invoice Ref] bound to [Invoice Ref] table field
-
-
Exit_Command23_Click:
-
Exit Sub
-
Err_Command23_Click:
-
MsgBox Err.Description
-
Resume Exit_Command23_Click
-
-
End Sub
Thanks so much! After a little playing around I got it working - I just took the ".defaultvalue" out of line 16.
Again thanks so much!
Thanks so much! After a little playing around I got it working - I just took the ".defaultvalue" out of line 16.
Again thanks so much!
Hi!
I'm glad you've made it work. I just want to straight out something.
Solution with .DefaultValue setting emulates Access Form/Subform relationships: - allows to add multiple records with the same FK value
- does not create a new record before user has entered data
Your solution with .Value setting: - creates a new record when Form2 is opened, if a user will not enter a data, then an empty record will be saved to table, you should take care to delete this record
- does not allow to add multiple records with the same FK value
Hi!
I'm glad you've made it work. I just want to straight out something.
Solution with .DefaultValue setting emulates Access Form/Subform relationships:- allows to add multiple records with the same FK value
- does not create a new record before user has entered data
Your solution with .Value setting:- creates a new record when Form2 is opened, if a user will not enter a data, then an empty record will be saved to table, you should take care to delete this record
- does not allow to add multiple records with the same FK value
Hi There
I've just noticed the fact it creates empty records. When ".DefaultValue" is in the code #Name? appears in the invoice reference field?
It only appears to work without .DefaultValue.
Any ideas?
Thanks
Dan
Hi There
I've just noticed the fact it creates empty records. When ".DefaultValue" is in the code #Name? appears in the invoice reference field?
It only appears to work without .DefaultValue.
Any ideas?
Thanks
Dan
Post your sub as it looks now.
Post your sub as it looks now.
Since last spoke re-arranged a bit (forms different names etc) - Private Sub Command12_Click()
-
-
On Error GoTo Err_Command12_Click
-
-
Dim stDocName As String
-
Dim stLinkCriterea As String
-
-
stDocName = "002b Inv"
-
stLinkCriterea = "[InvoiceReference]=" & "'" & Me![Invoice No] & "'"
-
-
With DoCmd
-
.RunCommand acCmdSaveRecord
-
.OpenForm stDocName, , , stLinkCriterea
-
End With
-
-
Forms![002b Inv]![InvoiceReference] = Me![Invoice No]
-
' Assuming form [002b Inv]
-
' has control named [InvoiceReference] bound to [InvoiceReference] table field
-
-
Exit_Command12_Click:
-
Exit Sub
-
Err_Command12_Click:
-
MsgBox Err.Description
-
Resume Exit_Command12_Click
-
-
End Sub
-
Since last spoke re-arranged a bit (forms different names etc) - Private Sub Command12_Click()
-
-
On Error GoTo Err_Command12_Click
-
-
Dim stDocName As String
-
Dim stLinkCriterea As String
-
-
stDocName = "002b Inv"
-
stLinkCriterea = "[InvoiceReference]=" & "'" & Me![Invoice No] & "'"
-
-
With DoCmd
-
.RunCommand acCmdSaveRecord
-
.OpenForm stDocName, , , stLinkCriterea
-
End With
-
-
Forms![002b Inv]![InvoiceReference] = Me![Invoice No]
-
' Assuming form [002b Inv]
-
' has control named [InvoiceReference] bound to [InvoiceReference] table field
-
-
Exit_Command12_Click:
-
Exit Sub
-
Err_Command12_Click:
-
MsgBox Err.Description
-
Resume Exit_Command12_Click
-
-
End Sub
-
Ok.
Change line #16 to - Forms![002b Inv]![InvoiceReference].DefaultValue = "'" & Me![Invoice No] & "'"
Ok.
Change line #16 to - Forms![002b Inv]![InvoiceReference].DefaultValue = "'" & Me![Invoice No] & "'"
Thats great, thanks ever so much for your help!
Dan
Thats great, thanks ever so much for your help!
Dan
Glad you've made it work.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jason |
last post by:
Let's say I have an html form with 20 or 30 fields in it. The form
submits the fields via POST to a php page which updates a table in a
database with the $_POST vars. Which makes more sense?
...
|
by: Old Timer |
last post by:
I wish to type in a number in my "Code" field, for instance 1060, I
then wish the number 1060 to trigger an event that will fill in the
next field (township field) For instance, 1060 brings up and...
|
by: Harry Devine |
last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept
correctly. My grid shows values from 5 database fields. I only need to
update that last 4 fields. The last field is a...
|
by: barret bonden |
last post by:
(closest newsgroup I could find)
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype....
|
by: Hexman |
last post by:
I've come up with an error which the solution eludes me. I get the
error:
>An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in HRTest.exe
>
>Additional...
|
by: anon1m0us |
last post by:
Here is a code for ASP inputs being updated in Excel. However, when I
click to submit the user, the excel does not get updated!
<% @Language="VBScript" %>
<%
Dim con
Dim rst
Dim strCon
Dim...
|
by: sara |
last post by:
I have a Memo field in a table to hold notes from a conversation a
social worker has had with a client (this is for a non-profit).
If the user needs to update the memo field, I need to find the...
|
by: directory |
last post by:
hey guys,
I've got a weird one for ya....i have a form which takes user input in
the form of textbox's etc. It then grabs some details from a file and
updates some of the labels with some info...
|
by: omerbutt |
last post by:
AJAX PROB WITH MULTIPLE RECORDS
helo iam having problem in ma code will any body look out an help, i am trying t add sale record in the database and the checkthe quantity of the part slod and...
|
by: AlexNunley |
last post by:
I've adopted a moderately sized (65k records) active use database (Access 2000, Windows XP). One of the most commonly used forms is whats called the RMA generation field, used to add claim...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |