How to navigate between two different tables in VB.NET (Access database) - database

In my VB.Net program I need to add the table "order" and "line of order".
If the first order is selected, I can only navigate the line(s) of order that is linked to the first order. I have no_order in my "line of order" table, so if it's the the first order, I need to only be able to navigate between the line of order with the value "1" in no_order.
In my program I already have the table "product" that I can navigate, delete, add, and modify. How much more complicated is this, or different to do what I just mentioned above? How should I go about doing this? I'm not sure where to start. Would it help if I posted my code from the "product" table?
Thanks.

If you are selecting orders from a dropdown and want lines of order on the same form then you should try this.
Bind the order dropdown on formLoad or PageLoad and set enable=false to 2nd dropdown (i.e of lines of code)
Bind the 2nd dropdown on 1st dropdown's selectedIndexChanged event with the query something like this.
/* ConnectionObject, CommandObject and all that */
select * from LinesofCode where no_order=#no_order
cmd.parameter.addwithValue("no_order",dropdown1st.selectedValue);

Related

How to Remove 「Total」 row in SSRS report?

I am new to SSRS.
In report, I have One table layout result where its first row (there is a bug in total) and last row is having total of all the fields. (Like shown in below image)
Given 「Total」 in first row, which I want to remove from the Report simply. I have its source file and I tried already so many ways but I am not getting its solution.
Edited
Design View of the same is here
Row Groups Panel is looking like:
Group Properties:
Expression 1(top left most):
=Iif(Fields!LineCaption.Value="","TOTAL", Fields!DispOrder.Value & ". " & Fields!LineName.Value)
Expression 2(below of top left):
=Iif(Fields!LineCaption.Value=""," ", Fields!AddupInfo.Value)+ " "
Thank you to All Commentators for commenting and giving your precious time in my problem with suggestions.
But I have found my own way solution.
By creating condition on Row_Group Visibility option while it loads the data from server.
As「Total」field was getting calculated in Row_Group only. So in Visibility option, I checked for first Row that "If first row is not Line_Name(My field name) then Hide that Row".
Maybe this is not the accurate answer but this was the only option for me to add.
You can do it via the context menu in the matrix view, not in the "Row Group" are:

SSRS line subgrouping by lines and not by columns

I want to have a row subgroup that will act like a head line with the details belonging to each subgroup (see below)
This is what I've done so far
Add a parent row group with the field LibelDestinataire as you can see in the picture
This is the result I have
Something is wrong but I'm unsure where. I've used a table. I've tried with a matrix but it did not do what I expected.
Any tips are welcomed.
Create a new tablix, right click the details group, select Add Group / Parent Group and use this settings:
You will get a tablix like this:
Delete the left most column (created by the group).
Delete the first row and use the LibelDestinataire field in the selected cell.
Merge the three cell next to the first cell and set the other fields in the next row:
You will get something like this:
In preview it should be something like this:
Apply the color and formats you want to cells and you will get the desired result.
Let me know if this helps.

openoffice-base setting the Criterion of a query column from a Form

In an openoffice-base (ooBase) query, and in setting the Criterion of a column. How do I call a value from a Combo Box [combo_1] in a Form [Form1] to filter the query which produces my report?
In MSAccess it is [Forms]![Form1].[combo_1] but I can't find the syntax for ooBase any help appreciated
I can think of two ways to do this, and both of them are significantly more complicated compared to the MSAccess method.
The first way is to make the combo box save to one row of a filter table. To ensure it always saves to the same one row the "Content type" for this form or subform will need to be "SQL command" with the "Content" something like SELECT * FROM "Filter" WHERE "FilterID" = 1 (1, or whatever the primary key of the row you're using is).
Now set your query to have a join to that row of the filter table.
The second way is to use a macro. On your combobox the macro will be triggered by the event "Item status changed", and the macro would read the combo box selection and put it where you need the data to go.

How to differentiate between 2 drop downs having similar ID (with changing only last 3 digits) on the same page?

In my application in one of the create screen i have 2 drop downs having similar ID as below:
1st drop down ID: j_idt129_label
&
2nd drop down ID: j_idt147_label
Now i want to select a value from the first dropdown.
One way is By considering the XPATH without considering the dropdown's ID.
Is there any other way for this?
I think this would work for you. This will select the first dropdown:
(//select[contains(#id, 'j_itd')])[1]
To find the second one:
(//select[contains(#id, 'j_itd')])[2]
select is the tag I'm guessing is in your HTML, but you may need to update select to match the actual tag.
Are the drop down ID's (three digits) are keep on changing? If not, then you can directly use them, else, consider corresponding parent element and get its child (drop down) elements.

DLookUp behavior in Form_Current with Label Captions

Access 2010 here.
Ok, Dlookups appear behave different based on where they are used. I have this Dlookup
inside a ClockNo_AferUpdate() subroutine that works well on new form entries to change a label's caption to what is found in the "Employees" DB under "EmployeeName" field based on the entered "ClockNo" in a ClockNo combo-box:
Me.LabelName1.Caption = DLookup("[EmployeeName]", "Employees", "[ClockNo] =" & Forms![InspectionEntryForm]!ClockNo)
The Employees database has four fields: AutoNumber-type "ID," Number-type "ClockNo," Text-type "Shift," and Text-type "EmployeeName."
Re-EDIT:
The RowSource for the ClockNo combo box as it sources from the Employees database:
SELECT DISTINCTROW [ClockNo], [EmployeeName] FROM [Employees] ORDER BY [ClockNo];
END Re-EDIT
What I am looking for is the same functionality in Form_Current() so browsing through older entries preserves the Label's caption based on the entered ClockNo. Unfortunately, simply re-using the above Dlookup gives a "Run-time error '3075': Syntax error (missing operator) in query expression '[ClockNo] ='."
Attaching the Dlookup as a control source to a text box does work O.K, but labels seem to be the best use here. I have mucked about with the Criteria section of the Dloopkup for some time without any real success.
End goal is to have a simple label next to a combo box that displays the employee's name based on their current and past ClockNo entries. The name is stored in a separate Employees database alongside their clock number and their shift.
This should be quite simple as both the ClockNo entry and the Label operate on the same form with the same database. Thanks for your input!
You have a combo box named ClockNo with this as its Row Source:
SELECT DISTINCTROW [ClockNo], [EmployeeName]
FROM [Employees]
ORDER BY [ClockNo];
I'm not sure why you want DISTINCTROW there. I would have suspected DISTINCT to be more appropriate. But I don't think it matters.
The important point is that the combo already includes [EmployeeName], so you shouldn't need to use DLookup to fetch [EmployeeName] again. Simply read the value from the second column of the combo's selected row.
Imagine your form includes a text box named txtEmployeeName. In the form's current event, you could do this:
Me.txtEmployeeName = Me.ClockNo.Column(1)
Notice the column index numbers start with 0, so the second column is .Column(1).
And you could do the same thing in the combo's After Update event.
Finally, you wanted to change a label's .Caption, but I showed you how to change a text box's .Value. If you can't make this technique work with the label, just use a text box instead. You can set the text box's Enabled property to No and adjust its other properties so that it is visually indistinguishable from a label.
Another approach could be simpler still. If you want to keep [ClockNo] as the combo's bound value, but are willing to display [EmployeeName] as the combo's selected value, you can set the width of the first column ([ClockNo]) to zero. You would still see both [ClockNo] and [EmployeeName] in the dropdown. If this is acceptable, you wouldn't need to bother with a label or text box.

Resources